提交 2cb2bca2 编写于 作者: D DCloud_LXH

feat(harmony): button

上级 62355b9e
......@@ -34,6 +34,7 @@ declare var __DEV__: boolean
declare var __TEST__: boolean
declare var __NODE_JS__: boolean
declare var __APP_VIEW__: boolean
declare var __PLUS__: boolean
// Feature flags
declare var __VUE_OPTIONS_API__: boolean
......
......@@ -7,7 +7,7 @@ declare namespace NodeJS {
NODE_ENV: 'production' | 'development' | 'test'
UNI_NODE_ENV: 'production' | 'development' | 'test'
UNI_PLATFORM: UniApp.PLATFORM
UNI_APP_PLATFORM: 'android' | 'ios'
UNI_APP_PLATFORM: 'android' | 'ios' | 'harmony'
UNI_SUB_PLATFORM: 'quickapp-webview-huawei' | 'quickapp-webview-union'
UNI_UTS_PLATFORM: 'app-android' | 'app-ios' | 'web' | UniApp.PLATFORM
......
......@@ -9,18 +9,18 @@
"replacements": {
"process.env.NODE_ENV": "'production'",
"__X__": "false",
"__PLATFORM__": "'harmony'",
"__PLATFORM__": "'app'",
"__APP_VIEW__": "false",
"__VUE_OPTIONS_API__": "true",
"__VUE_PROD_DEVTOOLS__": "false",
"__VUE_PROD_HYDRATION_MISMATCH_DETAILS__": "false",
"__UNI_FEATURE_WX__": "true",
"__UNI_FEATURE_PROMISE__": "false",
"__UNI_FEATURE_I18N_EN__": "true",
"__UNI_FEATURE_I18N_ES__": "true",
"__UNI_FEATURE_I18N_FR__": "true",
"__UNI_FEATURE_I18N_ZH_HANS__": "true",
"__UNI_FEATURE_I18N_ZH_HANT__": "true",
"__UNI_FEATURE_I18N_EN__": "false",
"__UNI_FEATURE_I18N_ES__": "false",
"__UNI_FEATURE_I18N_FR__": "false",
"__UNI_FEATURE_I18N_ZH_HANS__": "false",
"__UNI_FEATURE_I18N_ZH_HANT__": "false",
"plus.os.name": "'Harmony'",
"plus.os.version": "''"
},
......
import { UniTextNode } from '@dcloudio/uni-app-plus/view/framework/dom/elements/UniTextNode'
import { UniComment } from '@dcloudio/uni-app-plus/view/framework/dom/elements/UniComment'
import { UniViewElement } from '@dcloudio/uni-app-plus/view/framework/dom/elements/UniViewElement'
import { UniButton } from '@dcloudio/uni-app-plus/view/framework/dom/components/UniButton'
export const BuiltInComponents = {
'#text': UniTextNode,
'#comment': UniComment,
VIEW: UniViewElement,
BUTTON: UniButton,
}
......@@ -4,6 +4,7 @@ import { extend } from '@vue/shared'
export default {
webview: {
currentWebview() {
// TODO getStyle
return extend({}, nativeChannel.invokeSync('currentWebview'))
},
postMessageToUniNView(data: any, id: string) {
......
......@@ -62,14 +62,15 @@ export default defineConfig({
__PLATFORM__: JSON.stringify('app'),
__NODE_JS__: false,
__APP_VIEW__: true,
__UNI_FEATURE_I18N_EN__: true,
__UNI_FEATURE_I18N_ES__: true,
__UNI_FEATURE_I18N_FR__: true,
__UNI_FEATURE_I18N_ZH_HANS__: true,
__UNI_FEATURE_I18N_ZH_HANT__: true,
__UNI_FEATURE_I18N_EN__: false,
__UNI_FEATURE_I18N_ES__: false,
__UNI_FEATURE_I18N_FR__: false,
__UNI_FEATURE_I18N_ZH_HANS__: false,
__UNI_FEATURE_I18N_ZH_HANT__: false,
__IMPORT_META_ENV_BASE_URL__: JSON.stringify(''),
'process.env.NODE_ENV': JSON.stringify('production'),
__X__: false,
__PLUS__: false,
'plus.os.name': "'Harmony'",
'plus.os.version': "''",
},
......
......@@ -70,6 +70,7 @@ export default defineConfig({
__IMPORT_META_ENV_BASE_URL__: JSON.stringify(''),
'process.env.NODE_ENV': JSON.stringify('production'),
__X__: false,
__PLUS__: true,
},
resolve: {
alias: [
......
......@@ -30,7 +30,7 @@ export default /*#__PURE__*/ defineBuiltInComponent({
false as unknown as UniFormCtx
)
const { hovering, binding } = useHover(props)
const { t } = useI18n()
const { t } = /*#__PURE__*/ useI18n()
const onClick = withWebEvent((e: Event, isLabelClick: boolean) => {
if (props.disabled) {
return e.stopImmediatePropagation()
......@@ -50,7 +50,7 @@ export default /*#__PURE__*/ defineBuiltInComponent({
}
return
}
if (__PLATFORM__ === 'app' && props.openType === 'feedback') {
if (__PLATFORM__ === 'app' && __PLUS__ && props.openType === 'feedback') {
openFeedback(
t('uni.button.feedback.title'),
t('uni.button.feedback.send')
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册