摘要:
使用库之前肯定是先安装库:(tips:指定版本可以在后面加上如@8.4.4) cnpm install --save swiper 这种方式可以将库保存到 package.json 中: 然后就是使用: 首先是引入库: 然后是挂载: 然后是使用其标签: 查看效果: 这个库的功能可以实现滑动操作: 可 阅读全文
摘要:
Vue生命周期有四个阶段,八个函数: beforeCreate(){ console.log("beforeCreate:创建之前") }, created(){ console.log("created:创建完成") }, beforeMount(){ console.log("beforeMou 阅读全文
摘要:
首先有两个组件: 父组件:App.vue 子组件:ComponentForOne.vue <template> <img alt="Vue logo" src="./assets/logo.png"> <!-- 下面使用组件:组件标签名 --> <ComponentForOne @onEvent=" 阅读全文
摘要:
创建一个自定义组件: <template> <h1>Here is ComponentForOne!!</h1> <p>{{title}}</p> <p>age = {{age}}</p> <ul style="background-color:aqua"> <li v-for="(item,ind 阅读全文
摘要:
一、组件 vue中的.vue文件可以简单理解为组件,放在components文件夹下,根组件就是App.vue: 二、使用components文件夹下自定义的组件步骤: 1、创建模板,组件一般模板为以下形式: 二、导出标识: 在 <script> 标签中编写 export default {} 来标 阅读全文