diff --git a/public/code/index.yml b/public/code/index.yml index f691a42..e6b89aa 100644 --- a/public/code/index.yml +++ b/public/code/index.yml @@ -1,4 +1,6 @@ - hello-world.jsx +- vue-at-element-2.x-input.js +- vue-at-element-1.x-input.js - vue-threejs.js - react-at.jsx - vue-at.js diff --git a/public/code/vue-at-element-1.x-input.js b/public/code/vue-at-element-1.x-input.js new file mode 100644 index 0000000..1a1ea8d --- /dev/null +++ b/public/code/vue-at-element-1.x-input.js @@ -0,0 +1,56 @@ +// await loadJs('https://cdn.jsdelivr.net/npm/vue@2.6.11/dist/vue.min.js') +await loadJs('https://unpkg.com/vue@2.6.11/dist/vue.min.js') + +await loadCss('https://unpkg.com/element-ui@1.4.13/lib/theme-default/index.css') +await loadJs('https://unpkg.com/element-ui@1.4.13/lib/index.js') + +await loadJs('https://unpkg.com/textarea-caret@3.1.0/index.js') +// await loadJs('https://unpkg.com/vue-at') +await loadJsForceUmd({ + url: 'https://unpkg.com/vue-at@2.5.0-beta.2/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: ` +
+

Vue-at with Element-ui 1.x

+
+ {{link}} +
+ + + + + + + + + +
+ `, + 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 ', + input2: '@fritx @huangruichang , v-model on ', + input3: '@fritx @huangruichang , one-line input-box ', + } + } +} diff --git a/public/code/vue-at-element-1.x-input.js.png b/public/code/vue-at-element-1.x-input.js.png new file mode 100644 index 0000000..5bf3694 Binary files /dev/null and b/public/code/vue-at-element-1.x-input.js.png differ diff --git a/public/code/vue-at-element-2.x-input.js b/public/code/vue-at-element-2.x-input.js new file mode 100644 index 0000000..dd62778 --- /dev/null +++ b/public/code/vue-at-element-2.x-input.js @@ -0,0 +1,56 @@ +// await loadJs('https://cdn.jsdelivr.net/npm/vue@2.6.11/dist/vue.min.js') +await loadJs('https://unpkg.com/vue@2.6.11/dist/vue.min.js') + +await loadCss('https://unpkg.com/element-ui@2.13.1/lib/theme-chalk/index.css') +await loadJs('https://unpkg.com/element-ui@2.13.1/lib/index.js') + +await loadJs('https://unpkg.com/textarea-caret@3.1.0/index.js') +// await loadJs('https://unpkg.com/vue-at') +await loadJsForceUmd({ + url: 'https://unpkg.com/vue-at@2.5.0-beta.2/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: ` +
+

Vue-at with Element-ui 2.x

+
+ {{link}} +
+ + + + + + + + + +
+ `, + 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 ', + input2: '@fritx @huangruichang , v-model on ', + input3: '@fritx @huangruichang , one-line input-box ', + } + } +} diff --git a/public/code/vue-at-element-2.x-input.js.png b/public/code/vue-at-element-2.x-input.js.png new file mode 100644 index 0000000..03c35be Binary files /dev/null and b/public/code/vue-at-element-2.x-input.js.png differ