From a9e77c4c7bdecd73cd916f89b9e24141e34c5649 Mon Sep 17 00:00:00 2001 From: undefined Date: Mon, 13 Mar 2023 19:04:30 +0800 Subject: [PATCH] ui: add tpl tsx example --- .../components/dialog/{index.ts => index.tsx} | 23 ++++++++------- .../{selectUser.ts => selectUser.tsx} | 29 ++++++++++--------- packages/ui-default/utils/base.ts | 16 ++++++++-- 3 files changed, 41 insertions(+), 27 deletions(-) rename packages/ui-default/components/dialog/{index.ts => index.tsx} (82%) rename packages/ui-default/components/{selectUser.ts => selectUser.tsx} (60%) diff --git a/packages/ui-default/components/dialog/index.ts b/packages/ui-default/components/dialog/index.tsx similarity index 82% rename from packages/ui-default/components/dialog/index.ts rename to packages/ui-default/components/dialog/index.tsx index b16f31d6a..9fe689436 100644 --- a/packages/ui-default/components/dialog/index.ts +++ b/packages/ui-default/components/dialog/index.tsx @@ -1,4 +1,5 @@ import $ from 'jquery'; +import React from 'react'; import { i18n, tpl } from 'vj/utils'; import DomDialog, { DialogOptions } from './DomDialog'; @@ -14,19 +15,19 @@ export class Dialog { $action: null, ...options, }; - let box = ''; - if (options.width) box += `width:${options.width};max-width:${options.width};`; - if (options.height) box += `height:${options.height};max-height:${options.height};`; - this.$dom = $(tpl` -