vue-cli 3.1を使っております。
こちらのモジュールをie11で使いたいです。
https://github.com/holiber/sl-vue-tree
babel-polyfilを使えばie11でも動作するという風にこちらに書いてあります。
しかしこのbabel-polyfilの使い方がいまいち分かりません。
"yarn add @babel/polyfill"をしてから
typescript
1//main.ts 2//ここに入れてみました 3import "@babel/polyfill" 4 5import Vue from 'vue'; 6import App from './App.vue'; 7import router from './router'; 8import store from './store'; 9 10Vue.config.productionTip = false; 11 12new Vue({ 13 router, 14 store, 15 render: (h) => h(App), 16}).$mount('#app');
typescript
1//App.vue 2//vue createコマンドで初期に作られるAbout.vueに書いております。 3 4<template> 5 <div class="about"> 6 <h1>This is an about page</h1> 7 <SlVueTree v-model="treeModel"> 8 9 </SlVueTree> 10 </div> 11</template> 12<script lang="ts"> 13import { Component, Vue } from "vue-property-decorator"; 14 15//sl-vue-tree 16import SlVueTree from "sl-vue-tree-original"; 17 18 19@Component({ 20 components: { 21 SlVueTree 22 } 23}) 24export default class About extends Vue { 25 26 public treeModel = [ 27 { 28 "title": "Item1", 29 "isLeaf": true 30 }, 31 { 32 "title": "Item2", 33 "isLeaf": true 34 }, 35 { 36 "title": "Folder1", 37 "isExpanded": true, 38 "children": [ 39 { 40 "title": "Item3", 41 "isLeaf": true 42 }, 43 { 44 "title": "Item4", 45 "isLeaf": true 46 }, 47 { 48 "title": "Folder2", 49 "children": [ 50 { 51 "title": "Item5", 52 "isLeaf": true 53 } 54 ] 55 } 56 ], 57 "isSelected": true 58 }, 59 { 60 "title": "Item6", 61 "isLeaf": true 62 } 63]; 64 65 } 66} 67</script>
ie11でうまく動きませんでした。
main.tsの頭でimportしてみたのですが
もしこのimportが正しいならば他の所に私のミスがあるのかもしれません。
あなたの回答
tips
プレビュー