嗯..一开始是想让 vue 路由直接返回json,不过好像有点难,
如果是直接用xhr还好说,直接拿过来就行

这里说的是本地的,根据stackoverflow上的是,将变量从另一个js引入

json.js

export const jsonInput = [
  { id: "1", title: "Mars" },
  { id: "2", title: "Venus" },
  { id: "3", title: "Pluto" }
];

Hello.vue

然后就能引用jsondata的数据了(也就是在jsonInput里的数据)

参考:
https://stackoverflow.com/questions/46699064/returning-json-with-vue-router

写好的路由是(关键是/Drawing/:id那个)

export default new Router({
    mode:'history',
    routes: [
        { path: '/', name: 'home', component:  App},
        { path: '/hello', name: 'Main', component: Hello },
        { path: '/Drawing/:id',name:'drawing',component:Drawing}
    ]
})

会把所有的/Drawing/1 或/Drawing/2都导向一个界面

然后对应的Drawing组件里直接用$route.params.id 就能拿到链接后的Id,

但是router-link这里比较发愁,要怎么生成一个链接
上网搜了一下, 咳咳原来直接..按js写就好 字符串 + 变量 没毛病!记得to前面的冒号

参考:https://blog.csdn.net/sangjinchao/article/details/70888259

最近想要在vue cli创建的项目里使用vue router,感觉一切正常结果却报错

原来是因为 在vue里面直接使用必须要用router这个名字

例如:

import router from './routes.js'

const app = new Vue({
  el: '#app',
  router,
  render: h => h(App)
})

如果你真的想起其他的名字也可以:

import routes from './routes.js'

const app = new Vue({
  el: '#app',
  router: routes,
  render: h => h(App)
})

所以这又是一个坑

参考: https://stackoverflow.com/questions/44618761/vue-router-error-typeerror-cannot-read-property-matched-of-undefined

Typecho 很轻便而且加载速度比wordpress快很多, 所以最后还是迁移了,

有几点需要注意

  1. 将/wp-content/uploads/放到Typecho的 /usr/uploads(图片和附件之类的),
    然后在typecho数据库执行查询

    UPDATE typecho_contents SET text = REPLACE(text,'https://你的博客域名/wp-content/uploads/','https://你的博客域名/usr/uploads/');

  2. 安装wordpress to typecho插件, 中间可能会出错,一般是wordpress里的草稿有问题,删掉这些未发布的草稿, 重新开始转换就行,插件会跳过前面重复的文章,不用担心重复导入
  3. 永久链接的转换, 将现在的链接格式改为wordpress的, 在设置-永久链接 里面使用自定义即可