forked from coldemo/gallery.code
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvue-at-element-2.x-input.js
More file actions
56 lines (52 loc) · 1.85 KB
/
vue-at-element-2.x-input.js
File metadata and controls
56 lines (52 loc) · 1.85 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
// await loadJs('https://cdn.jsdelivr.net/npm/[email protected]/dist/vue.min.js')
await loadJs('https://unpkg.com/[email protected]/dist/vue.min.js')
await loadCss('https://unpkg.com/[email protected]/lib/theme-chalk/index.css')
await loadJs('https://unpkg.com/[email protected]/lib/index.js')
await loadJs('https://unpkg.com/[email protected]/index.js')
// await loadJs('https://unpkg.com/vue-at')
await loadJsForceUmd({
url: 'https://unpkg.com/[email protected]/dist/vue-at-textarea.js',
name: 'VueAtTextarea',
deps: { 'textarea-caret': 'getCaretCoordinates' }
})
appendCss(`
.container { padding: 20px }
.editor { margin-top:20px }
`)
// Demo for issue #112 - "Does not work with el-input text"
// https://github.com/fritx/vue-at/issues/112
let App = {
components: { At: VueAtTextarea },
template: `
<div class="container">
<h1>Vue-at with Element-ui 2.x</h1>
<div v-for="link in links">
<a target="_blank" :href="link">{{link}}</a>
</div>
<at :members="members" v-model="input1">
<el-input type="textarea" class="editor" placeholder="This is not working.. v-model on <at>"></el-input>
</at>
<at :members="members">
<el-input type="textarea" class="editor" v-model="input2"></el-input>
</at>
<at :members="members">
<el-input type="textarea" :rows="1" resize="none" class="editor" v-model="input3"></el-input>
</at>
</div>
`,
data() {
return {
links: [
'https://github.com/fritx/vue-at',
'https://github.com/fritx/vue-at/issues/96',
'https://github.com/fritx/vue-at/issues/112',
],
members: [
'fritx', 'linguokang', 'huangruichang'
],
input1: '@fritx @huangruichang , v-model on <at> ',
input2: '@fritx @huangruichang , v-model on <el-input> ',
input3: '@fritx @huangruichang , one-line input-box ',
}
}
}