vue3+ts+vite+three,打包出错,不能打包pmx和vmd格式的文件
可能是由于打包工具不能识别这些格式的文件造成的,可以尝试使用一些特定的插件或工具来解决这个问题。
例如:
three-gltf-loader
pmx-parser
vmd-parser
<script setup>
(Composition API 的语法糖)<!-- 组合式 API 语法糖 script setup -->
<script lang="ts" setup>
import { ref, defineProps, defineEmits } from 'vue'
// 声明一个数据接收 defineProps
const props = defineProps({
msg: {
type: String,
default: ''
}
})
// 自定义事件
const emit = defineEmits(['increment'])
const msg = 'abc'
const count = ref(100)
const increment = () => {
count.value++
console.log('msg=>', props.msg)
// => Hello Vue 3 + TypeScript + Vite
// => abc (重名后会以本地的赋值为主)
// 导出自定义事件
emit('increment')
}
</script>