diff --git "a/\345\210\230\346\263\242/2021-6-11.md" "b/\345\210\230\346\263\242/2021-6-11.md" new file mode 100644 index 0000000000000000000000000000000000000000..44cc93c4a101c940cfcbe8b538625d9c9cc0538b --- /dev/null +++ "b/\345\210\230\346\263\242/2021-6-11.md" @@ -0,0 +1,4 @@ +# Vue的第十一天 +* 在liunx上安装Vue脚手架 +* 确保安装了node.js npm 以及yarn +* 安装脚手架后不需要环境变量配置其它照旧 \ No newline at end of file diff --git "a/\345\210\230\346\263\242/2021-6-12.md" "b/\345\210\230\346\263\242/2021-6-12.md" new file mode 100644 index 0000000000000000000000000000000000000000..4877813e37f653cc8601ce2c7adcdfde8597d77b --- /dev/null +++ "b/\345\210\230\346\263\242/2021-6-12.md" @@ -0,0 +1,51 @@ +# Vue的第十二天 +* npm install -g yarn @vue/cli 脚手架和Vue同时安装不需要环境配置 +* app.vue中添加主键 +``` + +``` +* 使用v-for +``` + + {{ item.hname }} + {{ item.xname }} + {{ item.yname }} + + +export default { + data: function () { + return { + zoolist: [ + { + id: 1, + hname: "大毛", + xname: "大红", + yname: "小猴", + }, + ], + }; + }, +}; + +``` +* 插入数据 +``` +

{{titile}}

+ +props:{ + titile:{ + type:String, + default:"今天是个好日子" + } + }, +``` \ No newline at end of file diff --git "a/\345\210\230\346\263\242/2021-6-8.md" "b/\345\210\230\346\263\242/2021-6-8.md" new file mode 100644 index 0000000000000000000000000000000000000000..3394c10aa75d2b153acee8edc56d305347971637 --- /dev/null +++ "b/\345\210\230\346\263\242/2021-6-8.md" @@ -0,0 +1,62 @@ +# Vue的第九天 +* 组件中的data必须是一个函数,且必须要返回一个对象 +* 组件的复用 +``` + + + + + Vue.component("todo",{ + data:function(){ + return{ + sum:0 + } + }, + template:`` + }); +``` +* 通过props向组件中的子组件传递数据 +``` + + + + +Vue.component("todo",{ + props:["title"], + template:`

{{title}}

` + }); +``` +* 组件的子组件只能有一个标签,但是可以用父元素来解决问题 +``` +Vue.component("todo",{ + props:["title"], + template:` +
+

{{title}}

+

{{title}}

+
+ ` + }); +``` +* 监听子组件$emit方法 +``` + + +Vue.component("todo",{ + props:["title"], + template:`
  • {{title.name}}
  • ` + }) +``` +* $emit第二个元素可以抛出一个值 +``` + + + Vue.component("todo",{ + props:["title"], + template:`
  • {{title.name}}
  • ` + }) +``` +* v-model在组件中使用 +``` + +``` \ No newline at end of file diff --git "a/\345\210\230\346\263\242/2021-6-9.md" "b/\345\210\230\346\263\242/2021-6-9.md" new file mode 100644 index 0000000000000000000000000000000000000000..823629beab785de2ce4e9f857e106f32291d4534 --- /dev/null +++ "b/\345\210\230\346\263\242/2021-6-9.md" @@ -0,0 +1,10 @@ +# Vue的第十天 +* 官方cli的安装 +* npm i -g yarn安装yarn +* yarn global add @vue/cli安装脚手架 +* yarn config set registry https://registry.npm.taobao.org设置淘宝镜像安装更快 +* 安装完后此电脑-属性-高级设置-环境变量-系统变量-path-(c:user/admin/appdata/local/yarn/bin) +* create Vue创建文件 +* 将创建项目打包 npm run build +* 项目可以挂载到nginx上浏览 +* 打开C:\Windows\System32\drivers\etc\hosts文件修改权限然后进入文件添加47.115.30.85 text.icu