神仙都没用 1 jaar geleden
bovenliggende
commit
833ea0c18c

+ 1 - 0
packages/crud/index.d.ts

@@ -161,6 +161,7 @@ declare namespace ClCrud {
 		advSearch: string;
 		searchKey: string;
 		placeholder: string;
+		placeholderSelect: string;
 		tips: string;
 		saveSuccess: string;
 		deleteSuccess: string;

+ 1 - 1
packages/crud/package.json

@@ -1,6 +1,6 @@
 {
 	"name": "@cool-vue/crud",
-	"version": "7.0.3",
+	"version": "7.0.4",
 	"private": false,
 	"main": "./dist/index.umd.min.js",
 	"typings": "types/index.d.ts",

+ 1 - 0
packages/crud/src/locale/en.ts

@@ -15,6 +15,7 @@ export default {
 	advSearch: "Advanced Search",
 	searchKey: "Search Keyword",
 	placeholder: "Please enter",
+	placeholderSelect: "Please select",
 	tips: "Tips",
 	saveSuccess: "Save successful",
 	deleteSuccess: "Delete successful",

+ 1 - 0
packages/crud/src/locale/ja.ts

@@ -15,6 +15,7 @@ export default {
 	advSearch: "高度な検索",
 	searchKey: "検索キーワード",
 	placeholder: "入力してください",
+	placeholderSelect: "選択してください",
 	tips: "ヒント",
 	saveSuccess: "保存が成功しました",
 	deleteSuccess: "削除が成功しました",

+ 1 - 0
packages/crud/src/locale/zh-cn.ts

@@ -15,6 +15,7 @@ export default {
 	advSearch: "高级搜索",
 	searchKey: "搜索关键字",
 	placeholder: "请输入",
+	placeholderSelect: "请选择",
 	tips: "提示",
 	saveSuccess: "保存成功",
 	deleteSuccess: "删除成功",

+ 1 - 0
packages/crud/src/locale/zh-tw.ts

@@ -15,6 +15,7 @@ export default {
 	advSearch: "高級搜索",
 	searchKey: "搜索關鍵字",
 	placeholder: "請輸入",
+	placeholderSelect: "請選擇",
 	tips: "提示",
 	saveSuccess: "保存成功",
 	deleteSuccess: "刪除成功",

+ 1 - 1
packages/crud/src/utils/parse.tsx

@@ -177,7 +177,7 @@ export function parseExtensionComponent(vnode: any) {
 						label = e.label;
 						value = e.value;
 					} else {
-						return <cl-error-message title={`组件渲染失败,options 参数错误`} />;
+						return <cl-error-message title={`Component options error`} />;
 					}
 
 					switch (vnode.name) {

+ 3 - 2
packages/crud/src/utils/vnode.tsx

@@ -110,6 +110,7 @@ export function parseNode(vnode: any, options: Options): VNode {
 
 // 渲染节点
 export function renderNode(vnode: any, options: Options) {
+	const config = useConfig();
 	const { item, scope, children, _data, render } = options || {};
 
 	if (!vnode) {
@@ -132,11 +133,11 @@ export function renderNode(vnode: any, options: Options) {
 
 			switch (item.component?.name) {
 				case "el-input":
-					placeholder = "请填写";
+					placeholder = config.dict.label.placeholder;
 					break;
 
 				case "el-select":
-					placeholder = "请选择";
+					placeholder = config.dict.label.placeholderSelect;
 					break;
 
 				default:

+ 1 - 0
packages/crud/types/locale/en.d.ts

@@ -15,6 +15,7 @@ declare const _default: {
     advSearch: string;
     searchKey: string;
     placeholder: string;
+    placeholderSelect: string;
     tips: string;
     saveSuccess: string;
     deleteSuccess: string;

+ 4 - 0
packages/crud/types/locale/index.d.ts

@@ -16,6 +16,7 @@ export declare const locale: {
         advSearch: string;
         searchKey: string;
         placeholder: string;
+        placeholderSelect: string;
         tips: string;
         saveSuccess: string;
         deleteSuccess: string;
@@ -46,6 +47,7 @@ export declare const locale: {
         advSearch: string;
         searchKey: string;
         placeholder: string;
+        placeholderSelect: string;
         tips: string;
         saveSuccess: string;
         deleteSuccess: string;
@@ -76,6 +78,7 @@ export declare const locale: {
         advSearch: string;
         searchKey: string;
         placeholder: string;
+        placeholderSelect: string;
         tips: string;
         saveSuccess: string;
         deleteSuccess: string;
@@ -106,6 +109,7 @@ export declare const locale: {
         advSearch: string;
         searchKey: string;
         placeholder: string;
+        placeholderSelect: string;
         tips: string;
         saveSuccess: string;
         deleteSuccess: string;

+ 1 - 0
packages/crud/types/locale/ja.d.ts

@@ -15,6 +15,7 @@ declare const _default: {
     advSearch: string;
     searchKey: string;
     placeholder: string;
+    placeholderSelect: string;
     tips: string;
     saveSuccess: string;
     deleteSuccess: string;

+ 1 - 0
packages/crud/types/locale/zh-cn.d.ts

@@ -15,6 +15,7 @@ declare const _default: {
     advSearch: string;
     searchKey: string;
     placeholder: string;
+    placeholderSelect: string;
     tips: string;
     saveSuccess: string;
     deleteSuccess: string;

+ 1 - 0
packages/crud/types/locale/zh-tw.d.ts

@@ -15,6 +15,7 @@ declare const _default: {
     advSearch: string;
     searchKey: string;
     placeholder: string;
+    placeholderSelect: string;
     tips: string;
     saveSuccess: string;
     deleteSuccess: string;