vue
Cribug8080
这个作者很懒,什么都没留下…
展开
-
SPA 应用路由原理
history模式<!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta http-equiv=...原创 2019-12-13 10:51:03 · 134 阅读 · 0 评论 -
Vue3 调试
clone 代码 git clone https://github.com/vuejs/vue-next.git文件tsconfig.json。更改属性sourceMap: true。文件rollup.config.js。函数createConfig中的return前添加一句话output.sourcemap = true执行命令npm run dev。会生成packages/vue/d...原创 2019-10-13 13:49:42 · 1146 阅读 · 0 评论 -
vue router --history, hash
vue路由history模式利用h5新特性,window.history.pushState()和window.history.replaceState()参数:window.history.pushState(state,title,url)state可以是任意对象,用来携带路由信息。先pushState然后replaceState就实现了地址转换,而且有历史。exa...原创 2018-12-28 17:19:48 · 216 阅读 · 0 评论 -
vue 中使用 marked + highlight.js 代码高亮
markdown 代码高亮需要依赖npm install marked --savenpm install highlight.js --save这里使用的主题是monokai-sublime.css可以自行更换主题。结果<template> <div> <div class="hljs" ref="hlDiv" v-html="code...原创 2019-03-22 19:06:27 · 9346 阅读 · 1 评论 -
snabbdom@0.7.3 文件内容
snabbdom@0.7.3snabbdom.js核心文件。包含init 返回patch函数h 返回vNodethunk patch优化类似于pureComponentscript方法引入后使用snabbdom全局变量。# 核心函数 返回patch函数function init(modules, domApi) { ...}modules是数组,可以是classM...原创 2019-08-28 15:09:28 · 310 阅读 · 0 评论