提交 75528a6a 编写于 作者: fxy060608's avatar fxy060608

wip(app): nvue

上级 a428188c
...@@ -274,6 +274,7 @@ function vueFactory(exports) { ...@@ -274,6 +274,7 @@ function vueFactory(exports) {
this.parentNode = null; this.parentNode = null;
this.nodeType = 3; this.nodeType = 3;
this.text = text; this.text = text;
this.children = [];
} }
} }
......
export function initComponents(Vue, weex) {
var components = function(vue) {
"use strict";
const OPEN_TYPES = [
"navigate",
"redirect",
"switchTab",
"reLaunch",
"navigateBack"
];
const navigatorProps = {
hoverClass: {
type: String,
default: "navigator-hover"
},
url: {
type: String,
default: ""
},
openType: {
type: String,
default: "navigate",
validator(value) {
return Boolean(~OPEN_TYPES.indexOf(value));
}
},
delta: {
type: Number,
default: 1
},
hoverStartTime: {
type: [Number, String],
default: 50
},
hoverStayTime: {
type: [Number, String],
default: 600
},
exists: {
type: String,
default: ""
},
hoverStopPropagation: {
type: Boolean,
default: false
}
};
function createNavigatorOnClick(props) {
return () => {
if (props.openType !== "navigateBack" && !props.url) {
console.error("<navigator/> should have url attribute when using navigateTo, redirectTo, reLaunch or switchTab");
return;
}
switch (props.openType) {
case "navigate":
uni.navigateTo({
url: props.url
});
break;
case "redirect":
uni.redirectTo({
url: props.url,
exists: props.exists
});
break;
case "switchTab":
uni.switchTab({
url: props.url
});
break;
case "reLaunch":
uni.reLaunch({
url: props.url
});
break;
case "navigateBack":
uni.navigateBack({
delta: props.delta
});
break;
}
};
}
var Navigator = vue.defineComponent({
name: "Navigator",
props: navigatorProps,
setup(props, {
slots
}) {
const onClick = createNavigatorOnClick(props);
return () => vue.createVNode("div", {
"onClick": onClick
}, [slots.default && slots.default()]);
}
});
var index = {
Navigator
};
return index;
}(Vue);
return components;
}
import type { ExtractPropTypes } from 'vue'
const OPEN_TYPES = [
'navigate',
'redirect',
'switchTab',
'reLaunch',
'navigateBack',
]
export const navigatorProps = {
hoverClass: {
type: String,
default: 'navigator-hover',
},
url: {
type: String,
default: '',
},
openType: {
type: String,
default: 'navigate',
validator(value: unknown) {
return Boolean(~OPEN_TYPES.indexOf(value as string))
},
},
delta: {
type: Number,
default: 1,
},
hoverStartTime: {
type: [Number, String],
default: 50,
},
hoverStayTime: {
type: [Number, String],
default: 600,
},
exists: {
type: String,
default: '',
},
hoverStopPropagation: {
type: Boolean,
default: false,
},
}
export function createNavigatorOnClick(
props: ExtractPropTypes<typeof navigatorProps>
) {
return () => {
if (props.openType !== 'navigateBack' && !props.url) {
console.error(
'<navigator/> should have url attribute when using navigateTo, redirectTo, reLaunch or switchTab'
)
return
}
switch (props.openType) {
case 'navigate':
uni.navigateTo({
url: props.url,
})
break
case 'redirect':
uni.redirectTo({
url: props.url,
// @ts-ignore
exists: props.exists,
})
break
case 'switchTab':
uni.switchTab({
url: props.url,
})
break
case 'reLaunch':
uni.reLaunch({
url: props.url,
})
break
case 'navigateBack':
uni.navigateBack({
delta: props.delta,
})
break
default:
break
}
}
}
import { getCurrentInstance, inject, onBeforeUnmount } from 'vue' import { getCurrentInstance, inject, onBeforeUnmount } from 'vue'
import { UniFormCtx, uniFormKey } from '../components/form' import { UniFormCtx, uniFormKey } from '../vue/form'
interface ValueState { interface ValueState {
value: string value: string
......
export * from './components' export * from './vue'
export { useOn, useSubscribe } from './helpers/useSubscribe' export { useOn, useSubscribe } from './helpers/useSubscribe'
export { useContextInfo, getContextInfo } from './helpers/useContextInfo' export { useContextInfo, getContextInfo } from './helpers/useContextInfo'
export { export {
...@@ -27,8 +27,8 @@ export { ...@@ -27,8 +27,8 @@ export {
defineUnsupportedComponent, defineUnsupportedComponent,
} from './helpers/component' } from './helpers/component'
export { flatVNode } from './helpers/flatVNode' export { flatVNode } from './helpers/flatVNode'
export { uniFormKey } from './components/form' export { uniFormKey } from './vue/form'
export type { UniFormCtx } from './components/form' export type { UniFormCtx } from './vue/form'
export type { DecodeOptions } from './helpers/text' export type { DecodeOptions } from './helpers/text'
export { useRebuild } from './helpers/useRebuild' export { useRebuild } from './helpers/useRebuild'
export { default as animation } from './helpers/animation' export { default as animation } from './helpers/animation'
import Navigator from './navigator'
export default {
Navigator,
}
import { defineComponent } from 'vue'
import {
createNavigatorOnClick,
navigatorProps,
} from '../../components/navigator'
export default defineComponent({
name: 'Navigator',
props: navigatorProps,
setup(props, { slots }) {
const onClick = createNavigatorOnClick(props)
return () => <div onClick={onClick}>{slots.default && slots.default()}</div>
},
})
...@@ -7,7 +7,7 @@ function t(t, n) { ...@@ -7,7 +7,7 @@ function t(t, n) {
} }
export function Decline() {} export function Decline() {}
Decline.prototype.x = function(e) { Decline.prototype.x = function (e) {
return Math.sqrt(e) return Math.sqrt(e)
} }
...@@ -17,7 +17,7 @@ export function Friction(e, t) { ...@@ -17,7 +17,7 @@ export function Friction(e, t) {
this._startTime = 0 this._startTime = 0
this._v = 0 this._v = 0
} }
Friction.prototype.setV = function(x, y) { Friction.prototype.setV = function (x, y) {
var n = Math.pow(Math.pow(x, 2) + Math.pow(y, 2), 0.5) var n = Math.pow(Math.pow(x, 2) + Math.pow(y, 2), 0.5)
this._x_v = x this._x_v = x
this._y_v = y this._y_v = y
...@@ -27,11 +27,11 @@ Friction.prototype.setV = function(x, y) { ...@@ -27,11 +27,11 @@ Friction.prototype.setV = function(x, y) {
this._lastDt = null this._lastDt = null
this._startTime = new Date().getTime() this._startTime = new Date().getTime()
} }
Friction.prototype.setS = function(x, y) { Friction.prototype.setS = function (x, y) {
this._x_s = x this._x_s = x
this._y_s = y this._y_s = y
} }
Friction.prototype.s = function(t) { Friction.prototype.s = function (t) {
if (undefined === t) { if (undefined === t) {
t = (new Date().getTime() - this._startTime) / 1e3 t = (new Date().getTime() - this._startTime) / 1e3
} }
...@@ -55,10 +55,10 @@ Friction.prototype.s = function(t) { ...@@ -55,10 +55,10 @@ Friction.prototype.s = function(t) {
} }
return { return {
x, x,
y y,
} }
} }
Friction.prototype.ds = function(t) { Friction.prototype.ds = function (t) {
if (undefined === t) { if (undefined === t) {
t = (new Date().getTime() - this._startTime) / 1e3 t = (new Date().getTime() - this._startTime) / 1e3
} }
...@@ -67,19 +67,19 @@ Friction.prototype.ds = function(t) { ...@@ -67,19 +67,19 @@ Friction.prototype.ds = function(t) {
} }
return { return {
dx: this._x_v + this._x_a * t, dx: this._x_v + this._x_a * t,
dy: this._y_v + this._y_a * t dy: this._y_v + this._y_a * t,
} }
} }
Friction.prototype.delta = function() { Friction.prototype.delta = function () {
return { return {
x: (-1.5 * Math.pow(this._x_v, 2)) / this._x_a || 0, x: (-1.5 * Math.pow(this._x_v, 2)) / this._x_a || 0,
y: (-1.5 * Math.pow(this._y_v, 2)) / this._y_a || 0 y: (-1.5 * Math.pow(this._y_v, 2)) / this._y_a || 0,
} }
} }
Friction.prototype.dt = function() { Friction.prototype.dt = function () {
return -this._x_v / this._x_a return -this._x_v / this._x_a
} }
Friction.prototype.done = function() { Friction.prototype.done = function () {
var t = var t =
e(this.s().x, this._endPositionX) || e(this.s().x, this._endPositionX) ||
e(this.s().y, this._endPositionY) || e(this.s().y, this._endPositionY) ||
...@@ -87,11 +87,11 @@ Friction.prototype.done = function() { ...@@ -87,11 +87,11 @@ Friction.prototype.done = function() {
this._lastDt = null this._lastDt = null
return t return t
} }
Friction.prototype.setEnd = function(x, y) { Friction.prototype.setEnd = function (x, y) {
this._endPositionX = x this._endPositionX = x
this._endPositionY = y this._endPositionY = y
} }
Friction.prototype.reconfigure = function(m, f) { Friction.prototype.reconfigure = function (m, f) {
this._m = m this._m = m
this._f = 1e3 * f this._f = 1e3 * f
} }
...@@ -104,7 +104,7 @@ export function Spring(m, k, c) { ...@@ -104,7 +104,7 @@ export function Spring(m, k, c) {
this._endPosition = 0 this._endPosition = 0
this._startTime = 0 this._startTime = 0
} }
Spring.prototype._solve = function(e, t) { Spring.prototype._solve = function (e, t) {
var n = this._c var n = this._c
var i = this._m var i = this._m
var r = this._k var r = this._k
...@@ -114,13 +114,13 @@ Spring.prototype._solve = function(e, t) { ...@@ -114,13 +114,13 @@ Spring.prototype._solve = function(e, t) {
const s = e const s = e
const l = t / (a * e) const l = t / (a * e)
return { return {
x: function(e) { x: function (e) {
return (s + l * e) * Math.pow(Math.E, a * e) return (s + l * e) * Math.pow(Math.E, a * e)
}, },
dx: function(e) { dx: function (e) {
var t = Math.pow(Math.E, a * e) var t = Math.pow(Math.E, a * e)
return a * (s + l * e) * t + l * t return a * (s + l * e) * t + l * t
} },
} }
} }
if (o > 0) { if (o > 0) {
...@@ -129,7 +129,7 @@ Spring.prototype._solve = function(e, t) { ...@@ -129,7 +129,7 @@ Spring.prototype._solve = function(e, t) {
const d = (t - c * e) / (u - c) const d = (t - c * e) / (u - c)
const h = e - d const h = e - d
return { return {
x: function(e) { x: function (e) {
var t var t
var n var n
if (e === this._t) { if (e === this._t) {
...@@ -145,7 +145,7 @@ Spring.prototype._solve = function(e, t) { ...@@ -145,7 +145,7 @@ Spring.prototype._solve = function(e, t) {
} }
return h * t + d * n return h * t + d * n
}, },
dx: function(e) { dx: function (e) {
var t var t
var n var n
if (e === this._t) { if (e === this._t) {
...@@ -160,7 +160,7 @@ Spring.prototype._solve = function(e, t) { ...@@ -160,7 +160,7 @@ Spring.prototype._solve = function(e, t) {
n = this._powER2T = Math.pow(Math.E, u * e) n = this._powER2T = Math.pow(Math.E, u * e)
} }
return h * c * t + d * u * n return h * c * t + d * u * n
} },
} }
} }
var p = Math.sqrt(4 * i * r - n * n) / (2 * i) var p = Math.sqrt(4 * i * r - n * n) / (2 * i)
...@@ -168,32 +168,32 @@ Spring.prototype._solve = function(e, t) { ...@@ -168,32 +168,32 @@ Spring.prototype._solve = function(e, t) {
var v = e var v = e
var g = (t - f * e) / p var g = (t - f * e) / p
return { return {
x: function(e) { x: function (e) {
return ( return (
Math.pow(Math.E, f * e) * (v * Math.cos(p * e) + g * Math.sin(p * e)) Math.pow(Math.E, f * e) * (v * Math.cos(p * e) + g * Math.sin(p * e))
) )
}, },
dx: function(e) { dx: function (e) {
var t = Math.pow(Math.E, f * e) var t = Math.pow(Math.E, f * e)
var n = Math.cos(p * e) var n = Math.cos(p * e)
var i = Math.sin(p * e) var i = Math.sin(p * e)
return t * (g * p * n - v * p * i) + f * t * (g * i + v * n) return t * (g * p * n - v * p * i) + f * t * (g * i + v * n)
} },
} }
} }
Spring.prototype.x = function(e) { Spring.prototype.x = function (e) {
if (undefined === e) { if (undefined === e) {
e = (new Date().getTime() - this._startTime) / 1e3 e = (new Date().getTime() - this._startTime) / 1e3
} }
return this._solution ? this._endPosition + this._solution.x(e) : 0 return this._solution ? this._endPosition + this._solution.x(e) : 0
} }
Spring.prototype.dx = function(e) { Spring.prototype.dx = function (e) {
if (undefined === e) { if (undefined === e) {
e = (new Date().getTime() - this._startTime) / 1e3 e = (new Date().getTime() - this._startTime) / 1e3
} }
return this._solution ? this._solution.dx(e) : 0 return this._solution ? this._solution.dx(e) : 0
} }
Spring.prototype.setEnd = function(e, n, i) { Spring.prototype.setEnd = function (e, n, i) {
if (!i) { if (!i) {
i = new Date().getTime() i = new Date().getTime()
} }
...@@ -220,25 +220,25 @@ Spring.prototype.setEnd = function(e, n, i) { ...@@ -220,25 +220,25 @@ Spring.prototype.setEnd = function(e, n, i) {
} }
} }
} }
Spring.prototype.snap = function(e) { Spring.prototype.snap = function (e) {
this._startTime = new Date().getTime() this._startTime = new Date().getTime()
this._endPosition = e this._endPosition = e
this._solution = { this._solution = {
x: function() { x: function () {
return 0 return 0
}, },
dx: function() { dx: function () {
return 0 return 0
} },
} }
} }
Spring.prototype.done = function(n) { Spring.prototype.done = function (n) {
if (!n) { if (!n) {
n = new Date().getTime() n = new Date().getTime()
} }
return e(this.x(), this._endPosition, 0.1) && t(this.dx(), 0.1) return e(this.x(), this._endPosition, 0.1) && t(this.dx(), 0.1)
} }
Spring.prototype.reconfigure = function(m, t, c) { Spring.prototype.reconfigure = function (m, t, c) {
this._m = m this._m = m
this._k = t this._k = t
this._c = c this._c = c
...@@ -247,13 +247,13 @@ Spring.prototype.reconfigure = function(m, t, c) { ...@@ -247,13 +247,13 @@ Spring.prototype.reconfigure = function(m, t, c) {
this._startTime = new Date().getTime() this._startTime = new Date().getTime()
} }
} }
Spring.prototype.springConstant = function() { Spring.prototype.springConstant = function () {
return this._k return this._k
} }
Spring.prototype.damping = function() { Spring.prototype.damping = function () {
return this._c return this._c
} }
Spring.prototype.configuration = function() { Spring.prototype.configuration = function () {
function e(e, t) { function e(e, t) {
e.reconfigure(1, t, e.damping()) e.reconfigure(1, t, e.damping())
} }
...@@ -267,15 +267,15 @@ Spring.prototype.configuration = function() { ...@@ -267,15 +267,15 @@ Spring.prototype.configuration = function() {
read: this.springConstant.bind(this), read: this.springConstant.bind(this),
write: e.bind(this, this), write: e.bind(this, this),
min: 100, min: 100,
max: 1e3 max: 1e3,
}, },
{ {
label: 'Damping', label: 'Damping',
read: this.damping.bind(this), read: this.damping.bind(this),
write: t.bind(this, this), write: t.bind(this, this),
min: 1, min: 1,
max: 500 max: 500,
} },
] ]
} }
...@@ -285,28 +285,28 @@ export function STD(e, t, n) { ...@@ -285,28 +285,28 @@ export function STD(e, t, n) {
this._springScale = new Spring(e, t, n) this._springScale = new Spring(e, t, n)
this._startTime = 0 this._startTime = 0
} }
STD.prototype.setEnd = function(e, t, n, i) { STD.prototype.setEnd = function (e, t, n, i) {
var r = new Date().getTime() var r = new Date().getTime()
this._springX.setEnd(e, i, r) this._springX.setEnd(e, i, r)
this._springY.setEnd(t, i, r) this._springY.setEnd(t, i, r)
this._springScale.setEnd(n, i, r) this._springScale.setEnd(n, i, r)
this._startTime = r this._startTime = r
} }
STD.prototype.x = function() { STD.prototype.x = function () {
var e = (new Date().getTime() - this._startTime) / 1e3 var e = (new Date().getTime() - this._startTime) / 1e3
return { return {
x: this._springX.x(e), x: this._springX.x(e),
y: this._springY.x(e), y: this._springY.x(e),
scale: this._springScale.x(e) scale: this._springScale.x(e),
} }
} }
STD.prototype.done = function() { STD.prototype.done = function () {
var e = new Date().getTime() var e = new Date().getTime()
return ( return (
this._springX.done(e) && this._springY.done(e) && this._springScale.done(e) this._springX.done(e) && this._springY.done(e) && this._springScale.done(e)
) )
} }
STD.prototype.reconfigure = function(e, t, n) { STD.prototype.reconfigure = function (e, t, n) {
this._springX.reconfigure(e, t, n) this._springX.reconfigure(e, t, n)
this._springY.reconfigure(e, t, n) this._springY.reconfigure(e, t, n)
this._springScale.reconfigure(e, t, n) this._springScale.reconfigure(e, t, n)
......
import { getCurrentInstance } from 'vue' import { getCurrentInstance } from 'vue'
import { useHover } from '../../helpers/useHover'
import { defineBuiltInComponent } from '@dcloudio/uni-components' import { defineBuiltInComponent } from '@dcloudio/uni-components'
import { onEventPrevent } from '@dcloudio/uni-core' import { onEventPrevent } from '@dcloudio/uni-core'
const OPEN_TYPES = [ import { useHover } from '../../helpers/useHover'
'navigate', import {
'redirect', createNavigatorOnClick,
'switchTab', navigatorProps,
'reLaunch', } from '../../components/navigator'
'navigateBack',
]
const props = {
hoverClass: {
type: String,
default: 'navigator-hover',
},
url: {
type: String,
default: '',
},
openType: {
type: String,
default: 'navigate',
validator(value: unknown) {
return Boolean(~OPEN_TYPES.indexOf(value as string))
},
},
delta: {
type: Number,
default: 1,
},
hoverStartTime: {
type: [Number, String],
default: 50,
},
hoverStayTime: {
type: [Number, String],
default: 600,
},
exists: {
type: String,
default: '',
},
hoverStopPropagation: {
type: Boolean,
default: false,
},
}
export default /*#__PURE__*/ defineBuiltInComponent({ export default /*#__PURE__*/ defineBuiltInComponent({
name: 'Navigator', name: 'Navigator',
...@@ -55,52 +14,13 @@ export default /*#__PURE__*/ defineBuiltInComponent({ ...@@ -55,52 +14,13 @@ export default /*#__PURE__*/ defineBuiltInComponent({
compatConfig: { compatConfig: {
MODE: 3, MODE: 3,
}, },
props, props: navigatorProps,
setup(props, { slots }) { setup(props, { slots }) {
const vm = getCurrentInstance() const vm = getCurrentInstance()
const __scopeId = (vm && (vm.root.type as any).__scopeId) || '' const __scopeId = (vm && (vm.root.type as any).__scopeId) || ''
const { hovering, binding } = useHover(props) const { hovering, binding } = useHover(props)
function onClick($event: MouseEvent) { const onClick = createNavigatorOnClick(props)
if (props.openType !== 'navigateBack' && !props.url) {
console.error(
'<navigator/> should have url attribute when using navigateTo, redirectTo, reLaunch or switchTab'
)
return
}
switch (props.openType) {
case 'navigate':
uni.navigateTo({
url: props.url,
})
break
case 'redirect':
uni.redirectTo({
url: props.url,
// @ts-ignore
exists: props.exists,
})
break
case 'switchTab':
uni.switchTab({
url: props.url,
})
break
case 'reLaunch':
uni.reLaunch({
url: props.url,
})
break
case 'navigateBack':
uni.navigateBack({
delta: props.delta,
})
break
default:
break
}
}
return () => { return () => {
const { hoverClass, url } = props const { hoverClass, url } = props
......
import HTMLParser from '../../helpers/html-parser' import HTMLParser from '../../helpers/html-parser'
function removeDOCTYPE(html) { function removeDOCTYPE(html) {
return html return html
.replace(/<\?xml.*\?>\n/, '') .replace(/<\?xml.*\?>\n/, '')
.replace(/<!doctype.*>\n/, '') .replace(/<!doctype.*>\n/, '')
.replace(/<!DOCTYPE.*>\n/, '') .replace(/<!DOCTYPE.*>\n/, '')
} }
function parseAttrs(attrs) { function parseAttrs(attrs) {
return attrs.reduce(function(pre, attr) { return attrs.reduce(function (pre, attr) {
let value = attr.value let value = attr.value
const name = attr.name const name = attr.name
if (value.match(/ /) && name !== 'style') { if (value.match(/ /) && name !== 'style') {
value = value.split(' ') value = value.split(' ')
} }
if (pre[name]) { if (pre[name]) {
if (Array.isArray(pre[name])) { if (Array.isArray(pre[name])) {
pre[name].push(value) pre[name].push(value)
} else { } else {
pre[name] = [pre[name], value] pre[name] = [pre[name], value]
} }
} else { } else {
pre[name] = value pre[name] = value
} }
return pre return pre
}, {}) }, {})
} }
export default function parseHtml(html) { export default function parseHtml(html) {
html = removeDOCTYPE(html) html = removeDOCTYPE(html)
const stacks = [] const stacks = []
const results = { const results = {
node: 'root', node: 'root',
children: [] children: [],
} }
HTMLParser(html, { HTMLParser(html, {
start: function(tag, attrs, unary) { start: function (tag, attrs, unary) {
const node = { const node = {
name: tag name: tag,
} }
if (attrs.length !== 0) { if (attrs.length !== 0) {
node.attrs = parseAttrs(attrs) node.attrs = parseAttrs(attrs)
} }
if (unary) { if (unary) {
const parent = stacks[0] || results const parent = stacks[0] || results
if (!parent.children) { if (!parent.children) {
parent.children = [] parent.children = []
} }
parent.children.push(node) parent.children.push(node)
} else { } else {
stacks.unshift(node) stacks.unshift(node)
} }
}, },
end: function(tag) { end: function (tag) {
const node = stacks.shift() const node = stacks.shift()
if (node.name !== tag) console.error('invalid state: mismatch end tag') if (node.name !== tag) console.error('invalid state: mismatch end tag')
if (stacks.length === 0) { if (stacks.length === 0) {
results.children.push(node) results.children.push(node)
} else { } else {
const parent = stacks[0] const parent = stacks[0]
if (!parent.children) { if (!parent.children) {
parent.children = [] parent.children = []
} }
parent.children.push(node) parent.children.push(node)
} }
}, },
chars: function(text) { chars: function (text) {
const node = { const node = {
type: 'text', type: 'text',
text: text text: text,
} }
if (stacks.length === 0) { if (stacks.length === 0) {
results.children.push(node) results.children.push(node)
} else { } else {
const parent = stacks[0] const parent = stacks[0]
if (!parent.children) { if (!parent.children) {
parent.children = [] parent.children = []
} }
parent.children.push(node) parent.children.push(node)
} }
}, },
comment: function(text) { comment: function (text) {
const node = { const node = {
node: 'comment', node: 'comment',
text: text text: text,
} }
const parent = stacks[0] const parent = stacks[0]
if (!parent.children) { if (!parent.children) {
parent.children = [] parent.children = []
} }
parent.children.push(node) parent.children.push(node)
} },
}) })
return results.children return results.children
} }
import path from 'path'
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import vueJsx from '@vitejs/plugin-vue-jsx'
export default defineConfig({
root: __dirname,
build: {
minify: false,
lib: {
name: 'components',
entry: path.resolve(__dirname, 'src/nvue/index.ts'),
formats: ['iife'],
},
rollupOptions: {
external: ['uni', 'vue', 'weex'],
output: {
banner: 'export function initComponents(Vue, weex) {',
footer: 'return components\n}',
entryFileNames: 'components.js',
globals: {
uni: 'uni',
vue: 'Vue',
weex: 'weex',
},
},
},
},
plugins: [vue(), vueJsx({})],
})
...@@ -773,7 +773,7 @@ function provideForm(trigger) { ...@@ -773,7 +773,7 @@ function provideForm(trigger) {
return fields2; return fields2;
} }
const uniLabelKey = PolySymbol(process.env.NODE_ENV !== "production" ? "uniLabel" : "ul"); const uniLabelKey = PolySymbol(process.env.NODE_ENV !== "production" ? "uniLabel" : "ul");
const props$v = { const props$u = {
for: { for: {
type: String, type: String,
default: "" default: ""
...@@ -781,7 +781,7 @@ const props$v = { ...@@ -781,7 +781,7 @@ const props$v = {
}; };
var index$D = /* @__PURE__ */ defineBuiltInComponent({ var index$D = /* @__PURE__ */ defineBuiltInComponent({
name: "Label", name: "Label",
props: props$v, props: props$u,
setup(props2, { setup(props2, {
slots slots
}) { }) {
...@@ -1667,7 +1667,7 @@ function getTempCanvas(width = 0, height = 0) { ...@@ -1667,7 +1667,7 @@ function getTempCanvas(width = 0, height = 0) {
tempCanvas.height = height; tempCanvas.height = height;
return tempCanvas; return tempCanvas;
} }
const props$u = { const props$t = {
canvasId: { canvasId: {
type: String, type: String,
default: "" default: ""
...@@ -1683,7 +1683,7 @@ var index$B = /* @__PURE__ */ defineBuiltInComponent({ ...@@ -1683,7 +1683,7 @@ var index$B = /* @__PURE__ */ defineBuiltInComponent({
compatConfig: { compatConfig: {
MODE: 3 MODE: 3
}, },
props: props$u, props: props$t,
computed: { computed: {
id() { id() {
return this.canvasId; return this.canvasId;
...@@ -2140,7 +2140,7 @@ function useMethods(canvasRef, actionsWaiting) { ...@@ -2140,7 +2140,7 @@ function useMethods(canvasRef, actionsWaiting) {
}); });
} }
const uniCheckGroupKey = PolySymbol(process.env.NODE_ENV !== "production" ? "uniCheckGroup" : "ucg"); const uniCheckGroupKey = PolySymbol(process.env.NODE_ENV !== "production" ? "uniCheckGroup" : "ucg");
const props$t = { const props$s = {
name: { name: {
type: String, type: String,
default: "" default: ""
...@@ -2148,7 +2148,7 @@ const props$t = { ...@@ -2148,7 +2148,7 @@ const props$t = {
}; };
var index$A = /* @__PURE__ */ defineBuiltInComponent({ var index$A = /* @__PURE__ */ defineBuiltInComponent({
name: "CheckboxGroup", name: "CheckboxGroup",
props: props$t, props: props$s,
emits: ["change"], emits: ["change"],
setup(props2, { setup(props2, {
emit: emit2, emit: emit2,
...@@ -2200,7 +2200,7 @@ function useProvideCheckGroup(props2, trigger) { ...@@ -2200,7 +2200,7 @@ function useProvideCheckGroup(props2, trigger) {
} }
return getFieldsValue; return getFieldsValue;
} }
const props$s = { const props$r = {
checked: { checked: {
type: [Boolean, String], type: [Boolean, String],
default: false default: false
...@@ -2224,7 +2224,7 @@ const props$s = { ...@@ -2224,7 +2224,7 @@ const props$s = {
}; };
var index$z = /* @__PURE__ */ defineBuiltInComponent({ var index$z = /* @__PURE__ */ defineBuiltInComponent({
name: "Checkbox", name: "Checkbox",
props: props$s, props: props$r,
setup(props2, { setup(props2, {
slots slots
}) { }) {
...@@ -2291,7 +2291,7 @@ function useCheckboxInject(checkboxChecked, checkboxValue, reset) { ...@@ -2291,7 +2291,7 @@ function useCheckboxInject(checkboxChecked, checkboxValue, reset) {
let resetTimer; let resetTimer;
function iosHideKeyboard() { function iosHideKeyboard() {
} }
const props$r = { const props$q = {
cursorSpacing: { cursorSpacing: {
type: [Number, String], type: [Number, String],
default: 0 default: 0
...@@ -2463,7 +2463,7 @@ function useQuill(props2, rootRef, trigger) { ...@@ -2463,7 +2463,7 @@ function useQuill(props2, rootRef, trigger) {
useContextInfo(); useContextInfo();
useSubscribe(); useSubscribe();
} }
const props$q = /* @__PURE__ */ shared.extend({}, props$r, { const props$p = /* @__PURE__ */ shared.extend({}, props$q, {
id: { id: {
type: String, type: String,
default: "" default: ""
...@@ -2491,7 +2491,7 @@ const props$q = /* @__PURE__ */ shared.extend({}, props$r, { ...@@ -2491,7 +2491,7 @@ const props$q = /* @__PURE__ */ shared.extend({}, props$r, {
}); });
var index$y = /* @__PURE__ */ defineBuiltInComponent({ var index$y = /* @__PURE__ */ defineBuiltInComponent({
name: "Editor", name: "Editor",
props: props$q, props: props$p,
emit: ["ready", "focus", "blur", "input", "statuschange", ...emit$1], emit: ["ready", "focus", "blur", "input", "statuschange", ...emit$1],
setup(props2, { setup(props2, {
emit: emit2 emit: emit2
...@@ -2577,7 +2577,7 @@ var index$x = /* @__PURE__ */ defineBuiltInComponent({ ...@@ -2577,7 +2577,7 @@ var index$x = /* @__PURE__ */ defineBuiltInComponent({
}; };
} }
}); });
const props$p = { const props$o = {
src: { src: {
type: String, type: String,
default: "" default: ""
...@@ -2616,7 +2616,7 @@ const IMAGE_MODES = { ...@@ -2616,7 +2616,7 @@ const IMAGE_MODES = {
}; };
var index$w = /* @__PURE__ */ defineBuiltInComponent({ var index$w = /* @__PURE__ */ defineBuiltInComponent({
name: "Image", name: "Image",
props: props$p, props: props$o,
setup(props2, { setup(props2, {
emit: emit2 emit: emit2
}) { }) {
...@@ -2866,7 +2866,7 @@ const UniViewJSBridgeSubscribe = function() { ...@@ -2866,7 +2866,7 @@ const UniViewJSBridgeSubscribe = function() {
function getValueString(value) { function getValueString(value) {
return value === null ? "" : String(value); return value === null ? "" : String(value);
} }
const props$o = /* @__PURE__ */ shared.extend({}, { const props$n = /* @__PURE__ */ shared.extend({}, {
name: { name: {
type: String, type: String,
default: "" default: ""
...@@ -2935,7 +2935,7 @@ const props$o = /* @__PURE__ */ shared.extend({}, { ...@@ -2935,7 +2935,7 @@ const props$o = /* @__PURE__ */ shared.extend({}, {
type: Boolean, type: Boolean,
default: false default: false
} }
}, props$r); }, props$q);
const emit = [ const emit = [
"input", "input",
"focus", "focus",
...@@ -3130,7 +3130,7 @@ function useField(props2, rootRef, emit2, beforeInput) { ...@@ -3130,7 +3130,7 @@ function useField(props2, rootRef, emit2, beforeInput) {
trigger trigger
}; };
} }
const props$n = /* @__PURE__ */ shared.extend({}, props$o, { const props$m = /* @__PURE__ */ shared.extend({}, props$n, {
placeholderClass: { placeholderClass: {
type: String, type: String,
default: "input-placeholder" default: "input-placeholder"
...@@ -3142,7 +3142,7 @@ const props$n = /* @__PURE__ */ shared.extend({}, props$o, { ...@@ -3142,7 +3142,7 @@ const props$n = /* @__PURE__ */ shared.extend({}, props$o, {
}); });
var Input = /* @__PURE__ */ defineBuiltInComponent({ var Input = /* @__PURE__ */ defineBuiltInComponent({
name: "Input", name: "Input",
props: props$n, props: props$m,
emits: ["confirm", ...emit], emits: ["confirm", ...emit],
setup(props2, { setup(props2, {
emit: emit2 emit: emit2
...@@ -3320,7 +3320,7 @@ function flatVNode(nodes) { ...@@ -3320,7 +3320,7 @@ function flatVNode(nodes) {
} }
return array; return array;
} }
const props$m = { const props$l = {
scaleArea: { scaleArea: {
type: Boolean, type: Boolean,
default: false default: false
...@@ -3329,7 +3329,7 @@ const props$m = { ...@@ -3329,7 +3329,7 @@ const props$m = {
var index$v = /* @__PURE__ */ defineBuiltInComponent({ var index$v = /* @__PURE__ */ defineBuiltInComponent({
inheritAttrs: false, inheritAttrs: false,
name: "MovableArea", name: "MovableArea",
props: props$m, props: props$l,
setup(props2, { setup(props2, {
slots slots
}) { }) {
...@@ -3817,7 +3817,7 @@ STD.prototype.reconfigure = function(e2, t2, n) { ...@@ -3817,7 +3817,7 @@ STD.prototype.reconfigure = function(e2, t2, n) {
this._springY.reconfigure(e2, t2, n); this._springY.reconfigure(e2, t2, n);
this._springScale.reconfigure(e2, t2, n); this._springScale.reconfigure(e2, t2, n);
}; };
const props$l = { const props$k = {
direction: { direction: {
type: String, type: String,
default: "none" default: "none"
...@@ -3873,7 +3873,7 @@ const props$l = { ...@@ -3873,7 +3873,7 @@ const props$l = {
}; };
var index$u = /* @__PURE__ */ defineBuiltInComponent({ var index$u = /* @__PURE__ */ defineBuiltInComponent({
name: "MovableView", name: "MovableView",
props: props$l, props: props$k,
emits: ["change", "scale"], emits: ["change", "scale"],
setup(props2, { setup(props2, {
slots, slots,
...@@ -4244,8 +4244,14 @@ function useMovableViewState(props2, trigger, rootRef) { ...@@ -4244,8 +4244,14 @@ function useMovableViewState(props2, trigger, rootRef) {
setParent setParent
}; };
} }
const OPEN_TYPES = ["navigate", "redirect", "switchTab", "reLaunch", "navigateBack"]; const OPEN_TYPES = [
const props$k = { "navigate",
"redirect",
"switchTab",
"reLaunch",
"navigateBack"
];
const navigatorProps = {
hoverClass: { hoverClass: {
type: String, type: String,
default: "navigator-hover" default: "navigator-hover"
...@@ -4282,13 +4288,49 @@ const props$k = { ...@@ -4282,13 +4288,49 @@ const props$k = {
default: false default: false
} }
}; };
function createNavigatorOnClick(props2) {
return () => {
if (props2.openType !== "navigateBack" && !props2.url) {
console.error("<navigator/> should have url attribute when using navigateTo, redirectTo, reLaunch or switchTab");
return;
}
switch (props2.openType) {
case "navigate":
uni.navigateTo({
url: props2.url
});
break;
case "redirect":
uni.redirectTo({
url: props2.url,
exists: props2.exists
});
break;
case "switchTab":
uni.switchTab({
url: props2.url
});
break;
case "reLaunch":
uni.reLaunch({
url: props2.url
});
break;
case "navigateBack":
uni.navigateBack({
delta: props2.delta
});
break;
}
};
}
var index$t = /* @__PURE__ */ defineBuiltInComponent({ var index$t = /* @__PURE__ */ defineBuiltInComponent({
name: "Navigator", name: "Navigator",
inheritAttrs: false, inheritAttrs: false,
compatConfig: { compatConfig: {
MODE: 3 MODE: 3
}, },
props: props$k, props: navigatorProps,
setup(props2, { setup(props2, {
slots slots
}) { }) {
...@@ -4298,40 +4340,7 @@ var index$t = /* @__PURE__ */ defineBuiltInComponent({ ...@@ -4298,40 +4340,7 @@ var index$t = /* @__PURE__ */ defineBuiltInComponent({
hovering, hovering,
binding binding
} = useHover(props2); } = useHover(props2);
function onClick($event) { const onClick = createNavigatorOnClick(props2);
if (props2.openType !== "navigateBack" && !props2.url) {
console.error("<navigator/> should have url attribute when using navigateTo, redirectTo, reLaunch or switchTab");
return;
}
switch (props2.openType) {
case "navigate":
uni.navigateTo({
url: props2.url
});
break;
case "redirect":
uni.redirectTo({
url: props2.url,
exists: props2.exists
});
break;
case "switchTab":
uni.switchTab({
url: props2.url
});
break;
case "reLaunch":
uni.reLaunch({
url: props2.url
});
break;
case "navigateBack":
uni.navigateBack({
delta: props2.delta
});
break;
}
}
return () => { return () => {
const { const {
hoverClass, hoverClass,
...@@ -6399,7 +6408,7 @@ var index$j = /* @__PURE__ */ defineBuiltInComponent({ ...@@ -6399,7 +6408,7 @@ var index$j = /* @__PURE__ */ defineBuiltInComponent({
}; };
} }
}); });
const props$9 = /* @__PURE__ */ shared.extend({}, props$o, { const props$9 = /* @__PURE__ */ shared.extend({}, props$n, {
placeholderClass: { placeholderClass: {
type: String, type: String,
default: "input-placeholder" default: "input-placeholder"
......
...@@ -1805,7 +1805,7 @@ function provideForm(trigger) { ...@@ -1805,7 +1805,7 @@ function provideForm(trigger) {
return fields2; return fields2;
} }
const uniLabelKey = PolySymbol(process.env.NODE_ENV !== "production" ? "uniLabel" : "ul"); const uniLabelKey = PolySymbol(process.env.NODE_ENV !== "production" ? "uniLabel" : "ul");
const props$C = { const props$B = {
for: { for: {
type: String, type: String,
default: "" default: ""
...@@ -1813,7 +1813,7 @@ const props$C = { ...@@ -1813,7 +1813,7 @@ const props$C = {
}; };
var index$z = /* @__PURE__ */ defineBuiltInComponent({ var index$z = /* @__PURE__ */ defineBuiltInComponent({
name: "Label", name: "Label",
props: props$C, props: props$B,
setup(props2, { setup(props2, {
slots slots
}) { }) {
...@@ -6381,7 +6381,7 @@ function getTempCanvas(width = 0, height = 0) { ...@@ -6381,7 +6381,7 @@ function getTempCanvas(width = 0, height = 0) {
tempCanvas.height = height; tempCanvas.height = height;
return tempCanvas; return tempCanvas;
} }
const props$B = { const props$A = {
canvasId: { canvasId: {
type: String, type: String,
default: "" default: ""
...@@ -6397,7 +6397,7 @@ var index$w = /* @__PURE__ */ defineBuiltInComponent({ ...@@ -6397,7 +6397,7 @@ var index$w = /* @__PURE__ */ defineBuiltInComponent({
compatConfig: { compatConfig: {
MODE: 3 MODE: 3
}, },
props: props$B, props: props$A,
computed: { computed: {
id() { id() {
return this.canvasId; return this.canvasId;
...@@ -6857,7 +6857,7 @@ function useMethods(canvasRef, actionsWaiting) { ...@@ -6857,7 +6857,7 @@ function useMethods(canvasRef, actionsWaiting) {
}); });
} }
const uniCheckGroupKey = PolySymbol(process.env.NODE_ENV !== "production" ? "uniCheckGroup" : "ucg"); const uniCheckGroupKey = PolySymbol(process.env.NODE_ENV !== "production" ? "uniCheckGroup" : "ucg");
const props$A = { const props$z = {
name: { name: {
type: String, type: String,
default: "" default: ""
...@@ -6865,7 +6865,7 @@ const props$A = { ...@@ -6865,7 +6865,7 @@ const props$A = {
}; };
var index$v = /* @__PURE__ */ defineBuiltInComponent({ var index$v = /* @__PURE__ */ defineBuiltInComponent({
name: "CheckboxGroup", name: "CheckboxGroup",
props: props$A, props: props$z,
emits: ["change"], emits: ["change"],
setup(props2, { setup(props2, {
emit: emit2, emit: emit2,
...@@ -6917,7 +6917,7 @@ function useProvideCheckGroup(props2, trigger) { ...@@ -6917,7 +6917,7 @@ function useProvideCheckGroup(props2, trigger) {
} }
return getFieldsValue; return getFieldsValue;
} }
const props$z = { const props$y = {
checked: { checked: {
type: [Boolean, String], type: [Boolean, String],
default: false default: false
...@@ -6941,7 +6941,7 @@ const props$z = { ...@@ -6941,7 +6941,7 @@ const props$z = {
}; };
var index$u = /* @__PURE__ */ defineBuiltInComponent({ var index$u = /* @__PURE__ */ defineBuiltInComponent({
name: "Checkbox", name: "Checkbox",
props: props$z, props: props$y,
setup(props2, { setup(props2, {
slots slots
}) { }) {
...@@ -7018,7 +7018,7 @@ function useCheckboxInject(checkboxChecked, checkboxValue, reset) { ...@@ -7018,7 +7018,7 @@ function useCheckboxInject(checkboxChecked, checkboxValue, reset) {
let resetTimer; let resetTimer;
function iosHideKeyboard() { function iosHideKeyboard() {
} }
const props$y = { const props$x = {
cursorSpacing: { cursorSpacing: {
type: [Number, String], type: [Number, String],
default: 0 default: 0
...@@ -7795,7 +7795,7 @@ function useQuill(props2, rootRef, trigger) { ...@@ -7795,7 +7795,7 @@ function useQuill(props2, rootRef, trigger) {
} }
}, id2, true); }, id2, true);
} }
const props$x = /* @__PURE__ */ extend({}, props$y, { const props$w = /* @__PURE__ */ extend({}, props$x, {
id: { id: {
type: String, type: String,
default: "" default: ""
...@@ -7823,7 +7823,7 @@ const props$x = /* @__PURE__ */ extend({}, props$y, { ...@@ -7823,7 +7823,7 @@ const props$x = /* @__PURE__ */ extend({}, props$y, {
}); });
var index$t = /* @__PURE__ */ defineBuiltInComponent({ var index$t = /* @__PURE__ */ defineBuiltInComponent({
name: "Editor", name: "Editor",
props: props$x, props: props$w,
emit: ["ready", "focus", "blur", "input", "statuschange", ...emit$1], emit: ["ready", "focus", "blur", "input", "statuschange", ...emit$1],
setup(props2, { setup(props2, {
emit: emit2 emit: emit2
...@@ -7910,7 +7910,7 @@ var index$s = /* @__PURE__ */ defineBuiltInComponent({ ...@@ -7910,7 +7910,7 @@ var index$s = /* @__PURE__ */ defineBuiltInComponent({
}; };
} }
}); });
const props$w = { const props$v = {
src: { src: {
type: String, type: String,
default: "" default: ""
...@@ -7949,7 +7949,7 @@ const IMAGE_MODES = { ...@@ -7949,7 +7949,7 @@ const IMAGE_MODES = {
}; };
var index$r = /* @__PURE__ */ defineBuiltInComponent({ var index$r = /* @__PURE__ */ defineBuiltInComponent({
name: "Image", name: "Image",
props: props$w, props: props$v,
setup(props2, { setup(props2, {
emit: emit2 emit: emit2
}) { }) {
...@@ -8263,7 +8263,7 @@ const UniViewJSBridgeSubscribe = function() { ...@@ -8263,7 +8263,7 @@ const UniViewJSBridgeSubscribe = function() {
function getValueString(value) { function getValueString(value) {
return value === null ? "" : String(value); return value === null ? "" : String(value);
} }
const props$v = /* @__PURE__ */ extend({}, { const props$u = /* @__PURE__ */ extend({}, {
name: { name: {
type: String, type: String,
default: "" default: ""
...@@ -8332,7 +8332,7 @@ const props$v = /* @__PURE__ */ extend({}, { ...@@ -8332,7 +8332,7 @@ const props$v = /* @__PURE__ */ extend({}, {
type: Boolean, type: Boolean,
default: false default: false
} }
}, props$y); }, props$x);
const emit = [ const emit = [
"input", "input",
"focus", "focus",
...@@ -8536,7 +8536,7 @@ function useField(props2, rootRef, emit2, beforeInput) { ...@@ -8536,7 +8536,7 @@ function useField(props2, rootRef, emit2, beforeInput) {
trigger trigger
}; };
} }
const props$u = /* @__PURE__ */ extend({}, props$v, { const props$t = /* @__PURE__ */ extend({}, props$u, {
placeholderClass: { placeholderClass: {
type: String, type: String,
default: "input-placeholder" default: "input-placeholder"
...@@ -8548,7 +8548,7 @@ const props$u = /* @__PURE__ */ extend({}, props$v, { ...@@ -8548,7 +8548,7 @@ const props$u = /* @__PURE__ */ extend({}, props$v, {
}); });
var Input = /* @__PURE__ */ defineBuiltInComponent({ var Input = /* @__PURE__ */ defineBuiltInComponent({
name: "Input", name: "Input",
props: props$u, props: props$t,
emits: ["confirm", ...emit], emits: ["confirm", ...emit],
setup(props2, { setup(props2, {
emit: emit2 emit: emit2
...@@ -8726,7 +8726,7 @@ function flatVNode(nodes) { ...@@ -8726,7 +8726,7 @@ function flatVNode(nodes) {
} }
return array; return array;
} }
const props$t = { const props$s = {
scaleArea: { scaleArea: {
type: Boolean, type: Boolean,
default: false default: false
...@@ -8735,7 +8735,7 @@ const props$t = { ...@@ -8735,7 +8735,7 @@ const props$t = {
var MovableArea = /* @__PURE__ */ defineBuiltInComponent({ var MovableArea = /* @__PURE__ */ defineBuiltInComponent({
inheritAttrs: false, inheritAttrs: false,
name: "MovableArea", name: "MovableArea",
props: props$t, props: props$s,
setup(props2, { setup(props2, {
slots slots
}) { }) {
...@@ -9341,7 +9341,7 @@ STD.prototype.reconfigure = function(e2, t2, n) { ...@@ -9341,7 +9341,7 @@ STD.prototype.reconfigure = function(e2, t2, n) {
this._springY.reconfigure(e2, t2, n); this._springY.reconfigure(e2, t2, n);
this._springScale.reconfigure(e2, t2, n); this._springScale.reconfigure(e2, t2, n);
}; };
const props$s = { const props$r = {
direction: { direction: {
type: String, type: String,
default: "none" default: "none"
...@@ -9397,7 +9397,7 @@ const props$s = { ...@@ -9397,7 +9397,7 @@ const props$s = {
}; };
var MovableView = /* @__PURE__ */ defineBuiltInComponent({ var MovableView = /* @__PURE__ */ defineBuiltInComponent({
name: "MovableView", name: "MovableView",
props: props$s, props: props$r,
emits: ["change", "scale"], emits: ["change", "scale"],
setup(props2, { setup(props2, {
slots, slots,
...@@ -9980,8 +9980,14 @@ function useMovableViewState(props2, trigger, rootRef) { ...@@ -9980,8 +9980,14 @@ function useMovableViewState(props2, trigger, rootRef) {
setParent setParent
}; };
} }
const OPEN_TYPES = ["navigate", "redirect", "switchTab", "reLaunch", "navigateBack"]; const OPEN_TYPES = [
const props$r = { "navigate",
"redirect",
"switchTab",
"reLaunch",
"navigateBack"
];
const navigatorProps = {
hoverClass: { hoverClass: {
type: String, type: String,
default: "navigator-hover" default: "navigator-hover"
...@@ -10018,13 +10024,49 @@ const props$r = { ...@@ -10018,13 +10024,49 @@ const props$r = {
default: false default: false
} }
}; };
function createNavigatorOnClick(props2) {
return () => {
if (props2.openType !== "navigateBack" && !props2.url) {
console.error("<navigator/> should have url attribute when using navigateTo, redirectTo, reLaunch or switchTab");
return;
}
switch (props2.openType) {
case "navigate":
uni.navigateTo({
url: props2.url
});
break;
case "redirect":
uni.redirectTo({
url: props2.url,
exists: props2.exists
});
break;
case "switchTab":
uni.switchTab({
url: props2.url
});
break;
case "reLaunch":
uni.reLaunch({
url: props2.url
});
break;
case "navigateBack":
uni.navigateBack({
delta: props2.delta
});
break;
}
};
}
var index$q = /* @__PURE__ */ defineBuiltInComponent({ var index$q = /* @__PURE__ */ defineBuiltInComponent({
name: "Navigator", name: "Navigator",
inheritAttrs: false, inheritAttrs: false,
compatConfig: { compatConfig: {
MODE: 3 MODE: 3
}, },
props: props$r, props: navigatorProps,
setup(props2, { setup(props2, {
slots slots
}) { }) {
...@@ -10034,40 +10076,7 @@ var index$q = /* @__PURE__ */ defineBuiltInComponent({ ...@@ -10034,40 +10076,7 @@ var index$q = /* @__PURE__ */ defineBuiltInComponent({
hovering, hovering,
binding binding
} = useHover(props2); } = useHover(props2);
function onClick($event) { const onClick = createNavigatorOnClick(props2);
if (props2.openType !== "navigateBack" && !props2.url) {
console.error("<navigator/> should have url attribute when using navigateTo, redirectTo, reLaunch or switchTab");
return;
}
switch (props2.openType) {
case "navigate":
uni.navigateTo({
url: props2.url
});
break;
case "redirect":
uni.redirectTo({
url: props2.url,
exists: props2.exists
});
break;
case "switchTab":
uni.switchTab({
url: props2.url
});
break;
case "reLaunch":
uni.reLaunch({
url: props2.url
});
break;
case "navigateBack":
uni.navigateBack({
delta: props2.delta
});
break;
}
}
return () => { return () => {
const { const {
hoverClass, hoverClass,
...@@ -13232,7 +13241,7 @@ var index$j = /* @__PURE__ */ defineBuiltInComponent({ ...@@ -13232,7 +13241,7 @@ var index$j = /* @__PURE__ */ defineBuiltInComponent({
}; };
} }
}); });
const props$g = /* @__PURE__ */ extend({}, props$v, { const props$g = /* @__PURE__ */ extend({}, props$u, {
placeholderClass: { placeholderClass: {
type: String, type: String,
default: "input-placeholder" default: "input-placeholder"
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册