nuxt
择一城终老...
这个作者很懒,什么都没留下…
展开
-
vue路由传参方式 nuxt
vue路由传参常用的三种方式1、通过params来传递参数(本人常用)传递参数接收参数<li v-for="article in articles" @click="getDescribe(article.id)">2、通过path跳转 getDescribe(id) { // 直接调用$router.push 实现携带参数的跳转 this.$...翻译 2018-06-07 09:19:51 · 4722 阅读 · 2 评论 -
nuxt 路由扩展配置
霸气的把mimon中的-mi 去掉(在nuxt.config.js中) router: { extendRoutes (routes) { // 风骚的把-mi去掉 routes.forEach(element => { let path = element.path path = path.replace(/-mi$/,''...原创 2018-06-07 09:44:47 · 7248 阅读 · 0 评论 -
vue 锚点指令v-anchor
export default { inserted: function(el, binding) { el.onclick = function() { let total; if (binding.value == 0) { total = 0; } else { ...原创 2018-08-10 16:42:23 · 5669 阅读 · 4 评论