Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

我在使用动态插槽的时候报错:[plugin:vite:vue] Codegen node is missing for element/if/for node. Apply appropriate transforms first. #721

Open
chinawangyatao opened this issue Aug 23, 2024 · 0 comments
Labels
question Further information is requested

Comments

@chinawangyatao
Copy link

🧐 Problem Description

我在组件封装的时候用了动态插槽
image
但是他报错了
image
我不知道该怎么解决

💻 Sample code

`

<script setup lang="ts"> import { ICurdTableProps, IModeValuePagination } from './types/h-field-curd-table'; import { ITableEvents, ITableProps } from '@/components/h-components/h-data/types/h-field-table'; const modeValuePagination = defineModel('modeValuePagination', { type: Object, default: { 'limit.pageSize': 10, 'limit.currentPage': 1, total: 5 } }); const props = withDefaults(defineProps(), { pageSizes: () => [10, 30, 50, 100], tableColumn: () => ({}) as ITableProps, tableEvents: () => ({}) as ITableEvents }); </script>

<h-field-pagination
:page-count="Number(modeValuePagination.total)"
v-model:pageSize="modeValuePagination['limit.pageSize']"
v-model:currentPage="modeValuePagination['limit.currentPage']"
layout="sizes, prev, pager, next,total"
:page-sizes="props.pageSizes"
background
hideOnSinglePage

<style scoped lang="scss"> </style>

`

🚑 Other information

我的 packjson

{
"name": "vite_vue3_js_template",
"private": true,
"version": "0.0.0",
"type": "module",
"scripts": {
"once": "yarn && yarn dev",
"dev": "vite",
"build": "vite build",
"preview": "vite preview",
"prettier": "prettier . --write",
"jsdoc": "jsdoc src -r",
"codeGenerator": "cd codeGenerator && npm install && npm run start"
},
"dependencies": {
"@element-plus/icons-vue": "^2.3.1",
"@vitejs/plugin-vue-jsx": "^4.0.1",
"@vueuse/core": "^10.11.0",
"axios": "^1.7.3",
"element-plus": "^2.7.8",
"file-saver": "^2.0.5",
"fuse.js": "6.6.2",
"js-cookie": "^3.0.5",
"lodash-es": "^4.17.21",
"normalize.css": "^8.0.1",
"nprogress": "^0.2.0",
"pinia": "^2.2.0",
"pinia-plugin-persistedstate": "^3.2.1",
"unplugin-icons": "^0.19.1",
"vite-plugin-qiankun": "^1.0.15",
"vue": "^3.4.31",
"vue-router": "^4.4.2"
},
"devDependencies": {
"@vitejs/plugin-vue": "^5.0.5",
"autoprefixer": "^10.4.20",
"jsdoc": "^4.0.3",
"postcss": "^8.4.41",
"prettier": "3.3.3",
"sass": "^1.77.8",
"tailwindcss": "^3.4.7",
"typescript": "^5.5.4",
"unplugin-auto-import": "^0.18.2",
"unplugin-vue-components": "^0.27.3",
"vite": "^5.3.4"
}
}

@chinawangyatao chinawangyatao added the question Further information is requested label Aug 23, 2024
@chinawangyatao chinawangyatao changed the title [Question] Help 我在使用动态插槽的时候报错:[plugin:vite:vue] Codegen node is missing for element/if/for node. Apply appropriate transforms first. Aug 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant