上一页 1 ··· 3 4 5 6 7 8 9 10 11 ··· 15 下一页
摘要: vue2中ref操作原生Dom元素 vue3中实时更新DOM数据需要导入 基本数据类型 import {ref} from 'vue' 数据定义需要包裹ref 定义的数据vue将他放入了一个对象之中,所以在获取这个值时需要 如name.value这样获取。 <template> <h1>一个人的信息 阅读全文
posted @ 2022-01-27 16:57 ajaXJson 阅读(2925) 评论(0) 推荐(0) 编辑
摘要: // 源数据 let person = { name: '张三', age: 18 } //#region // 模拟Vue2中实现响应式 // let p = {} // Object.defineProperties(p, 'name', { // configurable: true, // 阅读全文
posted @ 2022-01-27 16:57 ajaXJson 阅读(45) 评论(0) 推荐(0) 编辑
摘要: Vue2可读取vue3的内容,而vue3不可读取vue2的 <script>//import {h} from 'vue'export default{name:'App', setup(){ //数据 let name='张三' let age = 18 //方法 function sayHell 阅读全文
posted @ 2022-01-27 16:56 ajaXJson 阅读(326) 评论(0) 推荐(0) 编辑
摘要: vue3中的export default中不需要分开data,methods等,统一写在setup中,并且取值时,不需要用this.name <template> <h1>一个人的信息</h1> <h2>姓名:{{name}}</h2> <h2>年龄:{{age}}</h2> <button @cl 阅读全文
posted @ 2022-01-27 16:56 ajaXJson 阅读(260) 评论(0) 推荐(0) 编辑
摘要: <template> <!-- Vue3组件中的模板结构可以没有跟标签> //<div> <img alt="Vue logo" src="./assets/logo.png"> //</div></template> 阅读全文
posted @ 2022-01-27 16:54 ajaXJson 阅读(632) 评论(0) 推荐(0) 编辑
摘要: Vue3 //引入的不再是Vue构造函数了,引入的是一个名为creatApp的工厂函数import {creatApp} from 'vue'import App from './App.vue'//创建应用实例对象 app(类似于之前Vue2中的vm,但app比vm更“轻”)const app = 阅读全文
posted @ 2022-01-27 16:53 ajaXJson 阅读(331) 评论(0) 推荐(0) 编辑
摘要: const userId = '123'router.push({ name: 'user', params: { userId }}) // -> /user/123router.push({ path: `/user/${userId}` }) // -> /user/123// 这里的 par 阅读全文
posted @ 2022-01-18 11:31 ajaXJson 阅读(224) 评论(0) 推荐(0) 编辑
摘要: </template> <div> <ECharts v-if="isShow"/> </div> </template> <script> ... export default { name: "index", components:{ ... ECharts }, data() { return 阅读全文
posted @ 2022-01-07 17:26 ajaXJson 阅读(553) 评论(0) 推荐(0) 编辑
摘要: 当修改定义的值时mutations中 updataInfo(state) { // 1修改属性,响应式 // console.log(state.info[0].age); // state.info[0].age = 22​ // 2添加属性 // (错误做法)这种方法不行,做不到响应式 // s 阅读全文
posted @ 2021-12-29 18:36 ajaXJson 阅读(410) 评论(0) 推荐(0) 编辑
摘要: query Url :localhost:8080/#/second?queryId=12121&queryName=aja params Url:localhost:8080/#/second/12121/params params只能搭配name使用不能和path一起用 //paramsthis 阅读全文
posted @ 2021-12-28 16:53 ajaXJson 阅读(1173) 评论(0) 推荐(0) 编辑
上一页 1 ··· 3 4 5 6 7 8 9 10 11 ··· 15 下一页