review:【antd】【mp】代码评审

This commit is contained in:
YunaiV
2025-11-17 13:57:41 +08:00
parent 6f0273ab4e
commit f11b7aea69
21 changed files with 101 additions and 140 deletions

View File

@@ -1,5 +1,4 @@
<script lang="ts" setup>
// DONE @hw名字可以缩写成 editor.vue文件名
import { computed, nextTick, ref, watch } from 'vue';
import { IconifyIcon } from '@vben/icons';
@@ -49,6 +48,7 @@ watch(menu, () => {
});
// ======================== 菜单编辑(素材选择) ========================
/** 选择素材 */
function selectMaterial(item: any) {
const articleId = item.articleId;
@@ -81,7 +81,6 @@ function deleteMaterial() {
<template>
<div>
<!-- DONE @hw尽量使用 tindwind 替代ps如果多个组件复用那就不用调整 -->
<div>
<div class="mb-[15px] text-right">
<Button type="primary" danger @click="emit('delete')">
@@ -139,7 +138,6 @@ function deleteMaterial() {
allow-clear
/>
</div>
<!-- DONE @hw1左侧 filed 宽度看看要不要统一2右侧的 input 宽度也处理下 -->
<div
class="mt-5 rounded-[5px] bg-white p-[20px_10px]"
v-if="menu.type === 'miniprogram'"
@@ -202,7 +200,6 @@ function deleteMaterial() {
</div>
<div v-else>
<Row justify="center">
<!-- DONE @hwhtml 标签里的 style 要用 tindwind 替代下 -->
<Col :span="24" class="text-center">
<Button type="primary" @click="showNewsDialog = true">
素材库选择

View File

@@ -1,4 +1,3 @@
// DONE @hw如果只有自己组件里用一般是 modules所以这个目录要改成 modules 哈(自己模块的一部分);如果要给外部的组件用,可以叫 components
export { default as MenuEditor } from './editor.vue';
export { default as MenuPreviewer } from './previewer.vue';
export type * from './types';

View File

@@ -1,5 +1,4 @@
<script lang="ts" setup>
// DONE @hw名字可以缩写成 previewer.vue文件名
import type { Menu } from './types';
import { computed } from 'vue';
@@ -44,7 +43,6 @@ function addMenu() {
/** 添加横向二级菜单parent 表示要操作的父菜单 */
function addSubMenu(i: number, parent: any) {
// DONE @hw可以 inline 掉。idea 或者 vscode 的一些告警,处理掉会更干净一些。
parent.children[parent.children.length] = {
name: '子菜单名称',
reply: {

View File

@@ -72,7 +72,6 @@ interface _Menu extends RawMenu {
export type Menu = Partial<_Menu>;
// DONE @hw这个要不合并到 types 里;
export const menuOptions = [
{
value: 'view',