我有一个 Vue 组件库。我通过汇总为浏览器构建。但是我不能在带有 CDN 的浏览器中使用。我究竟做错了什么?我已经尝试<script type="module">了很多其他的东西。这是一个例子:
<div id="app">
<MultiSplitPane split="horizontal" height="400px" width="1000px">
<Pane>
<template v-slot:content>
Content 1
</template>
</Pane>
<Pane>
<template v-slot:content>
Content 2
</template>
</Pane>
<Pane>
<template v-slot:content>
Content 3
</template>
</Pane>
</MultiSplitPane>
</div>
<script type="module">
import Vue from 'https://cdn.jsdelivr.net/npm/vue@2.6.12/dist/vue.esm.browser.js';
import { MultiSplitPane, Pane } from 'https://raw.githubusercontent.com/dgknca/vue-multi-split-pane/master/dist/vue-multi-split-pane.esm.js';
new Vue({
el: '#app',
components: { MultiSplitPane, Pane }
})
</script>
也试过这个
new Vue({
el: '#app'
})
<script src="https://cdn.jsdelivr.net/npm/vue@2.6.12/dist/vue.js"></script>
<script src="https://raw.githubusercontent.com/dgknca/vue-multi-split-pane/master/dist/vue-multi-split-pane.min.js"></script>
<div id="app">
<MultiSplitPane
split="horizontal"
height="400px"
width="1000px"
resizerWidth="30px"
classes="v-pane-custom">
<Pane>
<template v-slot:resizer>
resizer slot
</template>
<template v-slot:content>
Content 1
</template>
</Pane>
<Pane>
<template v-slot:content>
Content 2
</template>
</Pane>
<Pane>
<template v-slot:content>
Content 3
</template>
</Pane>
</MultiSplitPane>
</div>