随笔分类 - Vue笔记
摘要:父组件: <template> <el-button type="primary" plain @click="Newlyadded('addOrder')">新增</el-button> <Add ref="addOrder" v-if="addOrderVisible" :visible.syn
阅读全文
摘要:getNowTime() { var date = new Date(); year = date.getFullYear(); month = date.getMonth() + 1; var monthStr = month >= 10 ? month : "0" + month; day =
阅读全文
摘要:seeShare(){ let routeUrl = this.$router.resolve({ path: "/share", query: {id:96} }); //let routeUrl = this.$router.resolve(`/share/${96}`) window.open
阅读全文
摘要:创建路由文件 在项目的`src`目录下,创建`router.js`文件,用来专门管理路由,接下来所有的路由都写在这个文件中。 1.在router.js中导入vue-router import Vue from "vue";import VueRouter from "vue-router";Vue.
阅读全文
摘要:注册全局自定义指令 `v-focus` Vue.directive('focus', { // 当被绑定的元素插入到 DOM 中时…… inserted: function (el) { // 聚焦元素 el.focus() }}) 注册局部指令(directives ) directives: {
阅读全文
摘要:注册局部组件 1 引入组件import Users from './components/Users.vue'import Header from './components/Header.vue'import Footer from './components/Footer.vue'export
阅读全文
摘要:component: () => import() //需要babel插件 否则import报错 const App = () => import('../component/Login.vue');
阅读全文
摘要:Vue项目中常用的生命周期和参数 <script> import Confin from '@/components/sub/Confin'; export default { name: 'Fist', components: {Confin}, //注册组件,比如要插入另外一个写好的VUE文件买
阅读全文
摘要:1.创建如下图中的文件夹和文件 2.在 Loading.vue 中定义一个组件 <template> <div class="loading-box"> Loading... </div> </template> 3.在 index.js 中 引入 Loading.vue ,并导出 // 引入组件
阅读全文

浙公网安备 33010602011771号