-
Notifications
You must be signed in to change notification settings - Fork 114
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Backlog #2
Comments
very nice |
nice 🍻 @huangruichang |
Open
// http://stackoverflow.com/questions/15157435/get-last-character-before-caret-position-in-javascript
export function getPrecedingRange() {
const r = getRange()
if (r) {
const range = r.cloneRange()
range.collapse(true)
// 修复 "空格+表情+空格+@" range报错 应设(endContainer, 0)
// stackoverflow上的这段代码有bug
// var el = closest(range.endContainer, d => d.contentEditable)
// range.setStart(el, 0)
range.setStart(range.endContainer, 0)
return range
}
} error stack was:
|
# package.json
"peerDependencies": {
- "vue": "2.x"
+ "vue": "1.x"
},
"devDependencies": {
"babel-core": "^6.0.0",
"babel-loader": "^6.0.0",
+ "babel-plugin-transform-runtime": "^6.0.0",
"babel-preset-es2015": "^6.0.0",
"babel-preset-stage-0": "^6.16.0",
// ...
- "vue": "^2.1.0",
- "vue-loader": "^10.3.0",
+ "vue": "^1.0.28",
+ "vue-hot-reload-api": "^1.2.0",
+ "vue-html-loader": "^1.0.0",
+ "vue-loader": "^8.2.1",
"vue-style-loader": "^1.0.0",
- "vue-template-compiler": "^2.2.4",
- "webpack": "^2.1.0-beta.25",
- "webpack-dev-server": "^2.1.0-beta.9"
+ "webpack": "^1.12.2",
+ "webpack-dev-server": "^1.12.0"
} # .babelrc
- "presets": [
- "stage-0",
- ["es2015", { "modules": false }]
- ]
+ "presets": ["es2015", "stage-0"],
+ "plugins": ["transform-runtime"],
+ "comments": false # webpack/*.js
# ...
# main.js
new Vue({
- el: '#app',
- render: h => h(App)
+ el: 'body',
+ components: { App }
})
# index.html
<body>
- <div id="app"></div>
+ <app></app>
<script src="/dist/demo.js"></script>
</body>
- <div ref="wrap"
+ <div v-el:wrap
- <li v-for="(item, index) in atwho.list"
+ <li v-for="(index, item) in atwho.list"
- <template slot="item" scope="s">
- <img :src="s.item.avatar">
- <span v-text="s.item.name"></span>
+ <template slot="item">
+ <img data-src="item.avatar">
+ <span data-text="item.name"></span>
handleStateChange (state) {
forEach.call(els, el => {
const textNode = el.querySelector('[data-text]')
textNode.textContent = this.itemExpr(item, textExpr)
const imgNode = el.querySelector('[data-src]')
imgNode.src = this.itemExpr(item, imgExpr)
})
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
default: () => []
vue1 standalone npm repo(branch)The text was updated successfully, but these errors were encountered: