摘要: 1不带参数路由渲染(hash路由) 1.1定义三个组件 const Foo = {template:'<div>foo</div>'} const Bar = {template:'<div>bar</div>'} const NotFound = { template: '<div>NotFoun 阅读全文
posted @ 2022-06-11 22:07 lijun12138 阅读(490) 评论(0) 推荐(0)
摘要: 使用ui组件如elementUI的表单也会有自带的校验,vue也能自己定义校验规则插件 如 <script src="./vue.js"></script> <div id="app"> <form @submit="validate"> <input v-model="text"> <br> <i 阅读全文
posted @ 2022-06-11 21:34 lijun12138 阅读(447) 评论(0) 推荐(0)
摘要: 实现方式:类似于在数据字典中查找对应的翻译 <script src="./vue.js"></script> <div id="app"> <h1>{{$t('welcome-message')}}</h1> <button @click="changeLang('en')">English</bu 阅读全文
posted @ 2022-06-11 18:44 lijun12138 阅读(329) 评论(0) 推荐(0)