摘要:
官网: https://cli.vuejs.org/zh/ 一、安装脚手架 npm install -g @vue/cli 注意:安装过程有警告,安装完后,关闭窗口,重新打开cmd,输入vue,没有报错 二、切换到创建文件的目录,然后使用命令创建 vue create vue_test 耐心等待 三 阅读全文
posted @ 2025-01-01 21:38
市丸银
阅读(39)
评论(0)
推荐(0)
摘要:
一、安装 1、下载 https://nodejs.org/en/download/ 2、安装 3、测试 打开cmd 查看node 和npm 版本 node -v npm -v 二、环境配置 1、找到安装目录,新建 node_cache 和 node_global文件夹 2、以管理员权限打开cmd 输 阅读全文
posted @ 2025-01-01 21:18
市丸银
阅读(134)
评论(0)
推荐(0)
摘要:
文件 xx.vue,xx文件名,使用大驼峰 1、template 内 写 html ,注意添加div 2、script 写 vue核心功能, 注意name 和 引入子组件 3、style 写css格式 <template> </template> <script> export default { 阅读全文
posted @ 2025-01-01 20:06
市丸银
阅读(27)
评论(0)
推荐(0)
摘要:
一、VueComponent 1、组件的本质是 VueComponent的构造函数,是Vue.extend生成的 2、我们只需要写<组件名></组件名>,Vue解析时会帮我们创建组件的实例对象 即Vue帮我们执行的:new VueComponent({}) 3、注意:每次调佣Vue.extend({ 阅读全文
posted @ 2025-01-01 17:10
市丸银
阅读(61)
评论(0)
推荐(0)
摘要:
一、Vue组件使用的三大步 1、定义组件 2、注册组件 3、使用组件 二、定义组件 1、Vue.extend({})与new Vue({})基本相似,Vue.extend不适用el,data要写返回函数 2、template用来写html结构,注意要加div包裹起来 3、简写 const s = { 阅读全文
posted @ 2025-01-01 15:36
市丸银
阅读(50)
评论(0)
推荐(0)
摘要:
一、生命周期钩子 1、挂载流程 初始化生命周期->beforecreate->数据代理->created->初始化虚拟DOM->beforemount->虚拟DOM转化为真是DOM并挂在在页面->mounted 2、更新流程 数据发生改变->beforeupdate(此时数据发生改变,页面没变)-> 阅读全文
posted @ 2025-01-01 12:09
市丸银
阅读(41)
评论(0)
推荐(0)
摘要:
一、定义语法 1、局部 // 简单,只需要指令语法绑定元素和指令语法所在模块加载时使用 nev Vue({ ..., directives:{ // element指令绑定的dom,binding获取value 指令名(element, binding){ }, }, } // 详细,指令绑定元素、 阅读全文
posted @ 2025-01-01 09:37
市丸银
阅读(47)
评论(0)
推荐(0)

浙公网安备 33010602011771号