refactor: vue3.3 defineOptions

This commit is contained in:
xingyu
2023-06-21 19:14:34 +08:00
parent a5c7c886ee
commit 922f83d99c
259 changed files with 955 additions and 381 deletions

View File

@@ -115,7 +115,7 @@
</el-form>
<ProductAttributesAddForm ref="attributesAddFormRef" :propertyList="propertyList" />
</template>
<script lang="ts" name="ProductSpuBasicInfoForm" setup>
<script lang="ts" setup>
import { PropType } from 'vue'
import { copyValueToTarget } from '@/utils'
import { propTypes } from '@/utils/propTypes'
@@ -127,6 +127,8 @@ import { ProductAttributes, ProductAttributesAddForm, SkuList } from './index'
import * as ProductCategoryApi from '@/api/mall/product/category'
import { getSimpleBrandList } from '@/api/mall/product/brand'
defineOptions({ name: 'ProductSpuBasicInfoForm' })
const message = useMessage() // 消息弹窗
const props = defineProps({

View File

@@ -6,13 +6,15 @@
</el-form-item>
</el-form>
</template>
<script lang="ts" name="DescriptionForm" setup>
<script lang="ts" setup>
import type { SpuType } from '@/api/mall/product/spu'
import { Editor } from '@/components/Editor'
import { PropType } from 'vue'
import { propTypes } from '@/utils/propTypes'
import { copyValueToTarget } from '@/utils'
defineOptions({ name: 'DescriptionForm' })
const message = useMessage() // 消息弹窗
const props = defineProps({
propFormData: {

View File

@@ -51,12 +51,14 @@
</el-row>
</el-form>
</template>
<script lang="ts" name="OtherSettingsForm" setup>
<script lang="ts" setup>
import type { SpuType } from '@/api/mall/product/spu'
import { PropType } from 'vue'
import { propTypes } from '@/utils/propTypes'
import { copyValueToTarget } from '@/utils'
defineOptions({ name: 'OtherSettingsForm' })
const message = useMessage() // 消息弹窗
const props = defineProps({

View File

@@ -40,10 +40,12 @@
</el-col>
</template>
<script lang="ts" name="ProductAttributes" setup>
<script lang="ts" setup>
import { ElInput } from 'element-plus'
import * as PropertyApi from '@/api/mall/product/property'
defineOptions({ name: 'ProductAttributes' })
const { t } = useI18n() // 国际化
const message = useMessage() // 消息弹窗
const inputValue = ref('') // 输入框值

View File

@@ -17,9 +17,11 @@
</template>
</Dialog>
</template>
<script lang="ts" name="ProductPropertyForm" setup>
<script lang="ts" setup>
import * as PropertyApi from '@/api/mall/product/property'
defineOptions({ name: 'ProductPropertyForm' })
const { t } = useI18n() // 国际化
const message = useMessage() // 消息弹窗

View File

@@ -107,13 +107,15 @@
</el-table-column>
</el-table>
</template>
<script lang="ts" name="SkuList" setup>
<script lang="ts" setup>
import { PropType } from 'vue'
import { copyValueToTarget } from '@/utils'
import { propTypes } from '@/utils/propTypes'
import { UploadImg } from '@/components/UploadFile'
import type { Property, SkuType, SpuType } from '@/api/mall/product/spu'
defineOptions({ name: 'SkuList' })
const props = defineProps({
propFormData: {
type: Object as PropType<SpuType>,