上一页 1 ··· 6 7 8 9 10 11 12 13 14 ··· 86 下一页
摘要: 阅读全文
posted @ 2021-06-24 10:03 富坚老贼 阅读(16) 评论(0) 推荐(0) 编辑
摘要: 六、编程式路由 可以通过编程的方式进行url跳转 App.vue <template> <button @click="go">跳转到about</button> <router-view></router-view> </template> <script> export default { me 阅读全文
posted @ 2021-06-23 09:13 富坚老贼 阅读(177) 评论(0) 推荐(0) 编辑
摘要: 一、 安装 npm install vue-router@4 二、基础使用 定义路由 router.js import { createRouter,createWebHashHistory} from 'vue-router' import About from '../components/Ab 阅读全文
posted @ 2021-06-21 19:18 富坚老贼 阅读(282) 评论(0) 推荐(0) 编辑
摘要: 基本使用 <div id="vm"> <my-component>abc</my-component> </div> <script type="module"> import * as obj from './main.js' const app = Vue.createApp({ }); app 阅读全文
posted @ 2021-06-19 16:31 富坚老贼 阅读(153) 评论(0) 推荐(0) 编辑
摘要: <div id="vm"> <div>子组件点击时:{{count}}</div> <blog-post @myaddevent='fuaddevent'></blog-post> </div> <script type="module"> import * as obj from './main. 阅读全文
posted @ 2021-06-19 15:19 富坚老贼 阅读(3556) 评论(0) 推荐(0) 编辑
摘要: 父传子,非prop 阅读全文
posted @ 2021-06-19 11:42 富坚老贼 阅读(131) 评论(0) 推荐(0) 编辑
摘要: Prop是由父组件传递数据到子组件 1.通过props数组传递数据 <div id="vm"> <blog-t title="标题" subtitle='副标题'></blog-t> </div> <script> const app = Vue.createApp({}); app.compone 阅读全文
posted @ 2021-06-18 10:08 富坚老贼 阅读(2270) 评论(0) 推荐(0) 编辑
摘要: 组件和组件复用 <div id="vm"> <button-counter></button-counter> <button-counter></button-counter> </div> <script> const app = Vue.createApp({}); app.component 阅读全文
posted @ 2021-06-16 19:36 富坚老贼 阅读(963) 评论(0) 推荐(0) 编辑
摘要: 一、基础 v-model 指令在表单 <input>、<textarea> 及 <select> 元素上创建双向数据绑定 1.文本 <div id="vm"> <input v-model="message" placeholder="edit me" /> <p>Message is: {{ me 阅读全文
posted @ 2021-06-16 14:47 富坚老贼 阅读(805) 评论(0) 推荐(0) 编辑
摘要: 1.属性监听 <div id="vm"> <button v-on:click="counter += 1">点击</button> <p>{{ counter }} times</p> </div> <script> const v = Vue.createApp({ data() { retur 阅读全文
posted @ 2021-06-16 14:12 富坚老贼 阅读(325) 评论(0) 推荐(0) 编辑
上一页 1 ··· 6 7 8 9 10 11 12 13 14 ··· 86 下一页