.js 文件:
import template from './Template.html';
class VacationListForCompany extends HTMLElement {
constructor() {
super();
const root = this.attachShadow({mode:'open'});
const t = new template({ target: root });
}
}
window.customElements.define("vacation-list-for-company",
VacationListForCompany);
苗条/HTML文件
<h1> This is from SVELTE </h1>
<script>
export default {
};
</script>
在我的 Rollupfile 中 import svelte from 'rollup-plugin-svelte';
export default {
input: 'Widgets/VacationListForCompany/widget.js',
output: {
format: 'iife',
file: 'dist/vacationlistforcompany.js',
},
plugins: [
svelte({ include:'*.html'})
],
};
似乎汇总无法在导入时生成纤细的组件。我在这里误解了什么吗?