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

refactor(cli): easycom

上级 af280c26
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`easycom render 1`] = `
"import { resolveComponent as _resolveComponent, createVNode as _createVNode, openBlock as _openBlock, createBlock as _createBlock } from \\"vue\\"
import _component_test from '@/components/uni-test.vue'
import _component_test1 from '@/components/test1/test1.vue'
import _component_test2 from '@/uni_modules/plugin/components/test2/test2.vue'
import { CheckboxGroup as _component_v_uni_checkbox_group } from '@dcloudio/uni-h5/dist/uni-h5.esm.js'
import _style_v_uni_checkbox_group from '@dcloudio/uni-h5/style/checkbox-group.css'
export function render(_ctx, _cache, $props, $setup, $data, $options) {
// const _component_test = _resolveComponent(\\"test\\")
// const _component_test1 = _resolveComponent(\\"test1\\")
// const _component_test2 = _resolveComponent(\\"test2\\")
const _component_some_other_comp = _resolveComponent(\\"some-other-comp\\")
// const _component_v_uni_checkbox_group = _resolveComponent(\\"v-uni-checkbox-group\\")
return (_openBlock(), _createBlock(\\"template\\", null, [
_createVNode(_component_test),
_createVNode(_component_test1),
_createVNode(_component_test1),
_createVNode(_component_test2),
_createVNode(_component_some_other_comp),
_createVNode(_component_v_uni_checkbox_group),
_createVNode(_component_v_uni_checkbox_group)
]))
}"
`;
exports[`easycom render with setup 1`] = `
"import { createVNode as _createVNode, resolveComponent as _resolveComponent, openBlock as _openBlock, createBlock as _createBlock } from \\"vue\\"
import _component_test1 from '@/components/test1/test1.vue'
import _component_test2 from '@/uni_modules/plugin/components/test2/test2.vue'
import { CheckboxGroup as _component_v_uni_checkbox_group } from '@dcloudio/uni-h5/dist/uni-h5.esm.js'
import _style_v_uni_checkbox_group from '@dcloudio/uni-h5/style/checkbox-group.css'
export function render(_ctx, _cache, $props, $setup, $data, $options) {
// const _component_test1 = _resolveComponent(\\"test1\\")
// const _component_test2 = _resolveComponent(\\"test2\\")
// const _component_v_uni_checkbox_group = _resolveComponent(\\"v-uni-checkbox-group\\")
return (_openBlock(), _createBlock(\\"template\\", null, [
_createVNode($setup[\\"Test\\"]),
_createVNode(_component_test1),
_createVNode(_component_test1),
_createVNode(_component_test2),
_createVNode($setup[\\"SomeOtherComp\\"]),
_createVNode(_component_v_uni_checkbox_group),
_createVNode(_component_v_uni_checkbox_group)
]))
}"
`;
import path from 'path'
import { initEasycoms, matchEasycom } from '../src/easycom'
import { parse, compileTemplate, compileScript } from '@vue/compiler-sfc'
import { initEasycom, matchEasycom, vueCompilerOptions } from '../src'
const rootDir = path.resolve(__dirname, 'example')
const dirs = [
......@@ -8,31 +10,47 @@ const dirs = [
path.resolve(__dirname, 'example/uni_modules/plugin/components')
]
const template = `<template><test/><test1/><test1/><test2/><some-other-comp/><checkbox-group/><checkbox-group/></template>`
const sfcParseRes = parse(`${template}<script>export default {}</script>`)
const sfcParseResWithSetup = parse(
`${template}<script setup>import SomeOtherComp from './some-other-comp';import Test from './test';</script>`
)
const id = 'test'
const sfcScriptCompileOptions = { id }
const sfcScriptBlock = compileScript(
sfcParseRes.descriptor,
sfcScriptCompileOptions
)
const sfcScriptBlockWithSetup = compileScript(
sfcParseResWithSetup.descriptor,
sfcScriptCompileOptions
)
describe('easycom', () => {
test('initEasycoms with dirs', () => {
expect(initEasycoms({ dirs, rootDir })).toEqual([
test('initEasycom with dirs', () => {
expect(initEasycom({ dirs, rootDir })).toEqual([
{
pattern: new RegExp('^test$'),
replacement: '@/components/test/test'
replacement: '@/components/test/test.vue'
},
{
pattern: new RegExp('^test1$'),
replacement: '@/components/test1/test1'
replacement: '@/components/test1/test1.vue'
},
{
pattern: new RegExp('^test2$'),
replacement: '@/uni_modules/plugin/components/test2/test2'
replacement: '@/uni_modules/plugin/components/test2/test2.vue'
}
])
expect(matchEasycom('test')).toBe('@/components/test/test')
expect(matchEasycom('test1')).toBe('@/components/test1/test1')
expect(matchEasycom('test')).toBe('@/components/test/test.vue')
expect(matchEasycom('test1')).toBe('@/components/test1/test1.vue')
expect(matchEasycom('test2')).toBe(
'@/uni_modules/plugin/components/test2/test2'
'@/uni_modules/plugin/components/test2/test2.vue'
)
})
test('initEasycoms with custom', () => {
test('initEasycom with custom', () => {
expect(
initEasycoms({ custom: { '^uni-(.*)': '@/components/uni-$1.vue' } })
initEasycom({ custom: { '^uni-(.*)': '@/components/uni-$1.vue' } })
).toEqual([
{
pattern: new RegExp('^uni-(.*)'),
......@@ -42,9 +60,9 @@ describe('easycom', () => {
expect(matchEasycom('test')).toBe(false)
expect(matchEasycom('uni-test1')).toBe('@/components/uni-test1.vue')
})
test('initEasycoms with dirs and custom', () => {
test('initEasycom with dirs and custom', () => {
expect(
initEasycoms({
initEasycom({
dirs,
rootDir,
custom: { '^test$': '@/components/uni-test.vue' }
......@@ -56,13 +74,64 @@ describe('easycom', () => {
},
{
pattern: new RegExp('^test1$'),
replacement: '@/components/test1/test1'
replacement: '@/components/test1/test1.vue'
},
{
pattern: new RegExp('^test2$'),
replacement: '@/uni_modules/plugin/components/test2/test2'
replacement: '@/uni_modules/plugin/components/test2/test2.vue'
}
])
expect(matchEasycom('test')).toBe('@/components/uni-test.vue')
})
test('render', () => {
initEasycom({
dirs,
rootDir,
custom: { '^test$': '@/components/uni-test.vue' }
})
const { code } = compileTemplate(
Object.assign(sfcParseRes.descriptor, {
id,
compilerOptions: Object.assign(
{
bindingMetadata: sfcScriptBlock.bindings
},
vueCompilerOptions
)
})
)
expect(code).toMatch(` // const _component_test = _resolveComponent("test")
// const _component_test1 = _resolveComponent("test1")
// const _component_test2 = _resolveComponent("test2")
const _component_some_other_comp = _resolveComponent("some-other-comp")
// const _component_v_uni_checkbox_group = _resolveComponent("v-uni-checkbox-group")`)
expect(code)
.toMatch(`import _component_test from '@/components/uni-test.vue'
import _component_test1 from '@/components/test1/test1.vue'
import _component_test2 from '@/uni_modules/plugin/components/test2/test2.vue'
import { CheckboxGroup as _component_v_uni_checkbox_group } from '@dcloudio/uni-h5/dist/uni-h5.esm.js'
import _style_v_uni_checkbox_group from '@dcloudio/uni-h5/style/checkbox-group.css'`)
expect(code).toMatchSnapshot()
})
test('render with setup', () => {
initEasycom({
dirs,
rootDir,
custom: { '^test$': '@/components/uni-test.vue' }
})
const { code } = compileTemplate(
Object.assign(sfcParseResWithSetup.descriptor, {
id,
compilerOptions: Object.assign(
{ bindingMetadata: sfcScriptBlockWithSetup.bindings },
vueCompilerOptions
)
})
)
expect(code)
.toMatch(` // const _component_test1 = _resolveComponent("test1")
// const _component_test2 = _resolveComponent("test2")
// const _component_v_uni_checkbox_group = _resolveComponent("v-uni-checkbox-group")`)
expect(code).toMatchSnapshot()
})
})
......@@ -22,9 +22,12 @@
"url": "https://github.com/dcloudio/uni-app/issues"
},
"dependencies": {
"@dcloudio/uni-shared": "^3.0.0",
"@vue/compiler-core": "^3.0.4",
"debug": "^4.3.1",
"strip-json-comments": "^3.1.1",
"xregexp": "3.1.0"
},
"peerDependencies": {
"@dcloudio/uni-shared": "^3.0.0"
}
}
import fs from 'fs'
import path from 'path'
import debug from 'debug'
interface EasycomOption {
dirs?: string[]
rootDir?: string
custom?: EasycomCustom
extensions?: string[]
}
interface EasycomMatcher {
pattern: RegExp
......@@ -14,22 +15,32 @@ interface EasycomCustom {
[key: string]: string
}
export const debugEasycom = debug('easycom')
const easycoms: EasycomMatcher[] = []
const easycomsCache = new Map<string, string>()
const easycomsInvalidCache = new Set<string>()
function clearEasycoms() {
let hasEasycom = false
function clearEasycom() {
easycoms.length = 0
easycomsCache.clear()
easycomsInvalidCache.clear()
}
export function initEasycoms({ dirs, rootDir, custom }: EasycomOption) {
clearEasycoms()
export function initEasycom({
dirs,
rootDir,
custom,
extensions = ['.vue']
}: EasycomOption) {
debugEasycom(dirs, rootDir, custom, extensions)
clearEasycom()
const easycomsObj = Object.create(null)
if (dirs && rootDir) {
Object.assign(easycomsObj, initAutoScanEasycoms(dirs, rootDir))
Object.assign(easycomsObj, initAutoScanEasycoms(dirs, rootDir, extensions))
}
if (custom) {
Object.assign(easycomsObj, custom)
......@@ -40,10 +51,15 @@ export function initEasycoms({ dirs, rootDir, custom }: EasycomOption) {
replacement: easycomsObj[name]
})
})
debugEasycom(easycoms)
hasEasycom = !!easycoms.length
return easycoms
}
export function matchEasycom(tag: string) {
if (!hasEasycom) {
return
}
let source = easycomsCache.get(tag)
if (source) {
return source
......@@ -58,6 +74,7 @@ export function matchEasycom(tag: string) {
}
source = tag.replace(matcher.pattern, matcher.replacement)
easycomsCache.set(tag, source)
debugEasycom('matchEasycom', tag, source)
return source
}
......@@ -65,8 +82,12 @@ const isDir = (path: string) => fs.lstatSync(path).isDirectory()
function initAutoScanEasycom(
dir: string,
rootDir: string
rootDir: string,
extensions: string[]
): Record<string, string> {
if (!path.isAbsolute(dir)) {
dir = path.resolve(rootDir, dir)
}
const easycoms = Object.create(null)
if (!fs.existsSync(dir)) {
return easycoms
......@@ -78,17 +99,26 @@ function initAutoScanEasycom(
}
const importDir = path.relative(rootDir, folder)
const files = fs.readdirSync(folder)
if (files.find(file => path.parse(file).name === name)) {
easycoms[`^${name}$`] = `@/${importDir}/${name}`
// 读取文件夹文件列表,比对文件名(fs.existsSync在大小写不敏感的系统会匹配不准确)
for (let i = 0; i < extensions.length; i++) {
const ext = extensions[i]
if (files.includes(name + ext)) {
easycoms[`^${name}$`] = `@/${importDir}/${name}${ext}`
break
}
}
})
return easycoms
}
function initAutoScanEasycoms(dirs: string[], rootDir: string) {
function initAutoScanEasycoms(
dirs: string[],
rootDir: string,
extensions: string[]
) {
return dirs.reduce<Record<string, string>>(
(easycoms: Record<string, string>, dir: string) => {
const curEasycoms = initAutoScanEasycom(dir, rootDir)
const curEasycoms = initAutoScanEasycom(dir, rootDir, extensions)
Object.keys(curEasycoms).forEach(name => {
// Use the first component when name conflict
if (!easycoms[name]) {
......
export * from './json'
export * from './easycom'
export * from './vueCompilerOptions'
export * from './transforms/transformBuiltInComponent'
export * from './transforms/transformBuiltInEasycom'
export * from './transforms/transformEasycom'
export { isAutoImported } from './transforms/autoImport'
import {
ElementNode,
ConstantTypes,
TransformContext,
createSimpleExpression
} from '@vue/compiler-core'
export function addImport(
path: string,
node: ElementNode,
context: TransformContext
) {
// remove resolveComponent
context.components.delete(node.tag)
// add import
const importsArray = Array.from(context.imports)
const existing = importsArray.find(i => i.path === path)
if (existing) {
return
}
context.imports.add({
path,
exp: createSimpleExpression(name, false, node.loc, ConstantTypes.CAN_HOIST)
})
}
import {
ComponentNode,
ElementNode,
ElementTypes,
ExpressionNode,
RootNode,
SimpleExpressionNode,
TemplateChildNode,
TransformContext
} from '@vue/compiler-core'
interface ImportItem {
exp: string | ExpressionNode
path: string
}
const tags = new Set<string>()
export function isAutoImported(tag: string) {
return tags.has(tag)
}
export function addAutoImport(
tag: string,
importItem: ImportItem,
context: TransformContext
) {
tag && tags.add(tag)
const importPath = importItem.path
const importContent = (importItem.exp as SimpleExpressionNode).content
const importsArray = Array.from(context.imports)
const existing = importsArray.find(
i =>
i.path === importPath &&
(i.exp as SimpleExpressionNode).content === importContent
)
if (existing) {
return
}
context.imports.add(importItem)
return true
}
export const isComponentNode = (
node: RootNode | TemplateChildNode
): node is ComponentNode =>
(node as ElementNode).tagType === ElementTypes.COMPONENT
import { NodeTypes, NodeTransform } from '@vue/compiler-core'
import { camelize, capitalize } from '@vue/shared'
import { isBuiltInComponent } from '@dcloudio/uni-shared'
import {
ConstantTypes,
NodeTransform,
ElementNode,
createSimpleExpression,
toValidAssetId
} from '@vue/compiler-core'
import { addImport } from './addImport'
import { COMPONENT_PREFIX, isBuiltInComponent } from '@dcloudio/uni-shared'
const COMPONENTS_PATH = '@dcloudio/uni-h5/lib/'
import { addAutoImport, isComponentNode } from './autoImport'
const COMPONENTS_PATH = '@dcloudio/uni-h5/dist/uni-h5.esm.js'
const COMPONENTS_STYLE_PATH = '@dcloudio/uni-h5/style/'
function createComponentImportItem(oldTag: string, node: ElementNode) {
const tag = node.tag
return {
path: COMPONENTS_PATH,
exp: createSimpleExpression(
`{ ${capitalize(camelize(oldTag))} as ${toValidAssetId(
tag,
'component'
)} }`,
false,
node.loc,
ConstantTypes.CAN_HOIST
)
}
}
function createStyleImportItem(oldTag: string, node: ElementNode) {
return {
path: COMPONENTS_STYLE_PATH + oldTag + '.css',
exp: createSimpleExpression(
toValidAssetId(node.tag, 'style' as any),
false,
node.loc,
ConstantTypes.CAN_HOIST
)
}
}
export const transformBuiltInComponent: NodeTransform = (node, context) => {
if (node.type !== NodeTypes.ELEMENT) {
if (!isComponentNode(node)) {
return
}
const tag = node.tag
if (isBuiltInComponent(tag)) {
addImport(COMPONENTS_PATH + tag + '/index.js', node, context)
if (!isBuiltInComponent(tag)) {
return
}
node.tag = COMPONENT_PREFIX + tag
if (addAutoImport(node.tag, createComponentImportItem(tag, node), context)) {
addAutoImport('', createStyleImportItem(tag, node), context)
}
}
import { NodeTransform } from '@vue/compiler-core'
import { isComponentNode } from './autoImport'
export const transformBuiltInEasycom: NodeTransform = node => {
if (!isComponentNode(node)) {
return
}
if (node.tag === 'match-media' && process.env.UNI_PLATFORM !== 'mp-weixin') {
node.tag = 'uni-match-media'
}
}
import { NodeTypes, NodeTransform } from '@vue/compiler-core'
import { camelize, capitalize } from '@vue/shared'
import {
ConstantTypes,
NodeTransform,
createSimpleExpression,
toValidAssetId,
ComponentNode,
TransformContext
} from '@vue/compiler-core'
import { matchEasycom } from '../easycom'
import { COMPONENT_PREFIX } from '@dcloudio/uni-shared'
import { addImport } from './addImport'
import { debugEasycom, matchEasycom } from '../easycom'
import { addAutoImport, isComponentNode } from './autoImport'
function createImportItem(path: string, node: ComponentNode) {
const tag = node.tag
return {
path,
exp: createSimpleExpression(
toValidAssetId(tag, 'component'),
false,
node.loc,
ConstantTypes.CAN_HOIST
)
}
}
function isBinding(tag: string, context: TransformContext) {
const bindings = context.bindingMetadata
if (!bindings) {
return false
}
if (bindings[tag]) {
return true
}
const camelName = camelize(tag)
if (bindings[camelName]) {
return true
}
const PascalName = capitalize(camelName)
if (bindings[PascalName]) {
return true
}
return false
}
export const transformEasycom: NodeTransform = (node, context) => {
if (node.type !== NodeTypes.ELEMENT) {
if (!isComponentNode(node)) {
return
}
if (node.tag === 'match-media' && process.env.UNI_PLATFORM !== 'mp-weixin') {
node.tag = 'uni-match-media'
const tag = node.tag
// built-in component
if (tag.startsWith(COMPONENT_PREFIX)) {
return
}
const path = matchEasycom(node.tag)
if (path) {
addImport(path, node, context)
// https://github.com/vuejs/rfcs/blob/script-setup-2/active-rfcs/0000-script-setup.md#exposing-components-and-directives
if (isBinding(tag, context)) {
return debugEasycom(tag + ' is binding by setup')
}
const path = matchEasycom(tag)
path && addAutoImport(tag, createImportItem(path, node), context)
}
import { CompilerOptions } from '@vue/compiler-sfc'
import { isNativeTag } from '@dcloudio/uni-shared'
import { isAutoImported } from './transforms/autoImport'
import { transformBuiltInComponent } from './transforms/transformBuiltInComponent'
import { transformBuiltInEasycom } from './transforms/transformBuiltInEasycom'
import { transformEasycom } from './transforms/transformEasycom'
interface CodegenContext {
push: (code: string, node: any) => void
helper: (key: symbol) => string
}
interface VueCompilerOptions extends CompilerOptions {
onContextCreated: (context: CodegenContext) => void
}
const resolveComponentRE = /_resolveComponent\("(.*)"\)/
export const vueCompilerOptions: VueCompilerOptions = {
onContextCreated(context) {
const oldPush = context.push
context.push = (code, node) => {
const matches = code.match(resolveComponentRE)
// ignore auto imported component
if (matches && matches.length === 2 && isAutoImported(matches[1])) {
code = `// ${code}`
}
return oldPush(code, node)
}
},
isNativeTag,
nodeTransforms: [
transformBuiltInComponent,
transformBuiltInEasycom,
transformEasycom
]
}
uni-audio{
display:none;
}
uni-audio[controls]{
display:inline-block;
}
uni-audio[hidden]{
display:none;
}
.uni-audio-default{
max-width:100%;
min-width:302px;
height:65px;
background:#fcfcfc;
border:1px solid #e0e0e0;
border-radius:2.5px;
display:inline-block;
overflow:hidden;
}
.uni-audio-left{
width:65px;
height:65px;
float:left;
background-color:#e6e6e6;
background-size:100% 100%;
background-position:50% 50%;
}
.uni-audio-button{
width:24px;
height:24px;
margin:20.5px;
background-size:cover;
}
.uni-audio-button.play{
background-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RvTPee5czjKjxDCr2bMVnYNF9IO7fRRQAokHxIuPeCig3t4YKcAeUCIYiRrcffjwYUd8fPyHzo6PwuJ4XL9+/QAWrjILOHWmDu5SAWjHa500sBSNZoibUWKGvNnuDOKbNwFPLLytITYjUteAWIuOvNbZptQxxF1ZWXnYGWuCc57TRnjzhMFbGmIyI7MpJPbAdMpEuQzsKdc/hi+jT0tLO+NoE0tTSWsjL9h58vP45qe8YppSAQqBEmaXfAy0MlbJcJ+tXqUMUMMdlpsUIuE78JYVO89mznn7LvmUh8gL+xzKknVS6hmrZLiPETNrr1npmNG3oXsg7LCKaFobx1yzKhKhBE3sFnA+mCFuI4IyBuyWzYjb/MHQh+lFN09SPIxgirxIlxhepeIWiHL41vPBFl90i4MtykOROfVXA4tAT9YJisyJP3tMu4gnA29aB2UY4V4DXg1m/FMH9gMrMSd6jwwe8PxtAPMU6JC/2/wHuyI2cMsNBRIAAAAASUVORK5CYII=);
}
.uni-audio-button.pause{
background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAAAXNSR0IArs4c6QAABatJREFUaAXVWl1IpFUYnllZGUf3wlz6MXER1ES7s83VUDJw6KpdaSTDwMnYFSK6KNirooHullKQCNzQRjZ/wom1u9ALQ0mT1ktFdEBWXLdibaH1jwmx5zme83W+z2Hm+7bZmc8X3jl/73vO837n/z3j9aSBjo6O8lBNC7gZXAUuBxeCz4FJj8APwTHwCngaPOX1evcRZocAuhAcAt8G74KdEnWoyzpobGYIjfnBn4D/BqeLWBfr9Du1wmtXAZXnQPY9cBj8HNhEe3t7sbW1tfn19fW7m5ubD5aXl7dnZmYeUKipqel8dXV1UUlJyfmysrILFRUV9X6/n8PMSveREQYPYHgdWgsTpW0ZAPDPQ3kC/JJeCUEvLi7+NDg4+EskEvldL0sVD4VCz3Z1db1SW1v7egJj7kD/Coy4l6qelAYAfB0quQ02vno8Hr8/OTkZaWtrmzo4ODhK1Uiycp/P5x0fH28JBAKh3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PIapROX81zTYzEKkgNIQ8s4qwOH2d7PPQS9/T0vKjS2QqJQXqsFYSwxCrSpsmK6yVdi7zx0APmoVuvs7Pz/Wx55+jkHRoa+jonJ+cp4gHdAV+CAcbrjckASsCI0+vcpQGw7h6CVrDwRvMCTS8xvwbLM0Fsy+KZJha+1hCbiYw5oOdCkM86V1UejWBXZmJOsA22pXkeCIOvNAmfmk4MIQWaIYZTwiemYDAY3dracsUTU1IDpBGn95FP9Yac2KfzmVUzgkssHxfCYOGGR2gQvXp0jNG3lOyh+wKosrLykmWMq3q4SYXBth+6laLtEL3hqr8a2AZuFYQhrvizR8pJbAWeKA1j6OFuATeDq8D09hWClc+Jp0ceGHn/5hWWt8C0/N3mX15C4bDnCIuAAAAAAElFTkSuQmCC);
}
.uni-audio-right{
box-sizing:border-box;
height:65px;
margin-left:65px;
padding:11px 16.5px 13.5px 15px;
overflow:hidden;
}
.uni-audio-time{
margin-top:3.5px;
height:16.5px;
font-size:12px;
color:#888888;
float:right;
}
.uni-audio-info{
margin-right:70px;
overflow:hidden;
}
.uni-audio-name{
height:22.5px;
line-height:22.5px;
margin-bottom:3.5px;
font-size:14px;
color:#353535;
overflow:hidden;
white-space:nowrap;
text-overflow:ellipsis;
}
.uni-audio-author{
height:14.5px;
line-height:14.5px;
font-size:12px;
color:#888888;
overflow:hidden;
white-space:nowrap;
text-overflow:ellipsis;
}
import {isFunction} from "@vue/shared";
import {openBlock, createBlock, mergeProps, createVNode, toDisplayString} from "vue";
var subscriber = {
mounted() {
this._toggleListeners("subscribe", this.id);
this.$watch("id", (newId, oldId) => {
this._toggleListeners("unsubscribe", oldId, true);
this._toggleListeners("subscribe", newId, true);
});
},
beforeDestroy() {
this._toggleListeners("unsubscribe", this.id);
if (this._contextId) {
this._toggleListeners("unsubscribe", this._contextId);
}
},
methods: {
_toggleListeners(type, id, watch) {
if (watch && !id) {
return;
}
if (!isFunction(this._handleSubscribe)) {
return;
}
UniViewJSBridge[type](this.$page.id + "-" + this.$options.name.replace(/VUni([A-Z])/, "$1").toLowerCase() + "-" + id, this._handleSubscribe);
},
_getContextInfo() {
const id = `context-${this._uid}`;
if (!this._contextId) {
this._toggleListeners("subscribe", id);
this._contextId = id;
}
return {
name: this.$options.name.replace(/VUni([A-Z])/, "$1").toLowerCase(),
id,
page: this.$page.id
};
}
}
};
var script = {
name: "Audio",
mixins: [subscriber],
props: {
id: {
type: String,
default: ""
},
src: {
type: String,
default: ""
},
loop: {
type: [Boolean, String],
default: false
},
controls: {
type: [Boolean, String],
default: false
},
poster: {
type: String,
default: ""
},
name: {
type: String,
default: ""
},
author: {
type: String,
default: ""
}
},
data() {
return {
playing: false,
currentTime: this.getTime(0)
};
},
watch: {
src(val) {
if (this.$refs.audio) {
this.$refs.audio.src = this.$getRealPath(val);
}
}
},
mounted() {
const audio = this.$refs.audio;
audio.addEventListener("error", ($event) => {
this.playing = false;
this.$trigger("error", $event, {});
});
audio.addEventListener("play", ($event) => {
this.playing = true;
this.$trigger("play", $event, {});
});
audio.addEventListener("pause", ($event) => {
this.playing = false;
this.$trigger("pause", $event, {});
});
audio.addEventListener("ended", ($event) => {
this.playing = false;
this.$trigger("ended", $event, {});
});
audio.addEventListener("timeupdate", ($event) => {
var currentTime = audio.currentTime;
this.currentTime = this.getTime(currentTime);
var duration = audio.duration;
this.$trigger("timeupdate", $event, {
currentTime,
duration
});
});
audio.src = this.$getRealPath(this.src);
},
methods: {
_handleSubscribe({
type,
data = {}
}) {
var audio = this.$refs.audio;
switch (type) {
case "setSrc":
audio.src = this.$getRealPath(data.src);
this.$emit("update:src", data.src);
break;
case "play":
audio.play();
break;
case "pause":
audio.pause();
break;
case "seek":
audio.currentTime = data.position;
break;
}
},
trigger() {
if (this.playing) {
this.$refs.audio.pause();
} else {
this.$refs.audio.play();
}
},
getTime(time) {
var h = Math.floor(time / 3600);
var m = Math.floor(time % 3600 / 60);
var s = Math.floor(time % 3600 % 60);
h = (h < 10 ? "0" : "") + h;
m = (m < 10 ? "0" : "") + m;
s = (s < 10 ? "0" : "") + s;
var str = m + ":" + s;
if (h !== "00") {
str = h + ":" + str;
}
return str;
}
}
};
const _hoisted_1 = {class: "uni-audio-default"};
const _hoisted_2 = {class: "uni-audio-right"};
const _hoisted_3 = {class: "uni-audio-time"};
const _hoisted_4 = {class: "uni-audio-info"};
const _hoisted_5 = {class: "uni-audio-name"};
const _hoisted_6 = {class: "uni-audio-author"};
function render(_ctx, _cache, $props, $setup, $data, $options) {
return openBlock(), createBlock("uni-audio", mergeProps({
id: $props.id,
controls: !!$props.controls
}, _ctx.$attrs), [
createVNode("audio", {
ref: "audio",
loop: $props.loop,
style: {display: "none"}
}, null, 8, ["loop"]),
createVNode("div", _hoisted_1, [
createVNode("div", {
style: "background-image: url(" + _ctx.$getRealPath($props.poster) + ");",
class: "uni-audio-left"
}, [
createVNode("div", {
class: [{play: !$data.playing, pause: $data.playing}, "uni-audio-button"],
onClick: _cache[1] || (_cache[1] = (...args) => $options.trigger && $options.trigger(...args))
}, null, 2)
], 4),
createVNode("div", _hoisted_2, [
createVNode("div", _hoisted_3, toDisplayString($data.currentTime), 1),
createVNode("div", _hoisted_4, [
createVNode("div", _hoisted_5, toDisplayString($props.name), 1),
createVNode("div", _hoisted_6, toDisplayString($props.author), 1)
])
])
])
], 16, ["id", "controls"]);
}
script.render = render;
export default script;
......@@ -2,12 +2,7 @@
"private": true,
"name": "@dcloudio/uni-components",
"version": "3.0.0",
"main": "dist/uni-components.esm.js",
"module": "dist/uni-components.esm.js",
"description": "@dcloudio/uni-components",
"sideEffects": [
"dist/uni-components.css"
],
"buildOptions": {
"bundler": "vite"
},
......
......@@ -162,94 +162,3 @@ export default {
}
}
</script>
<style>
uni-audio {
display: none;
}
uni-audio[controls] {
display: inline-block;
}
uni-audio[hidden] {
display: none;
}
.uni-audio-default {
max-width: 100%;
min-width: 302px;
height: 65px;
background: #fcfcfc;
border: 1px solid #e0e0e0;
border-radius: 2.5px;
display: inline-block;
overflow: hidden;
}
.uni-audio-left {
width: 65px;
height: 65px;
float: left;
background-color: #e6e6e6;
background-size: 100% 100%;
background-position: 50% 50%;
}
.uni-audio-button {
width: 24px;
height: 24px;
margin: 20.5px;
background-size: cover;
}
.uni-audio-button.play {
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAAAXNSR0IArs4c6QAAB4dJREFUaAXNWg1MlVUYvpcfIRCJ+MnCaOBl8dOcOCEQZ9kmI5cQG5Yb6MifKbMaGVobOtlibTWHDpgpxBUwF07826iFsMkYJhg559JdGiQSkUzSBA0QkZ7n4/u+nXsvwf3jwru99/y/3/N+3znvec97rlbjABofH38GYtaAV4MjwDqwH9gHTBoE3wd3gA3gi+B6rVY7hHR2CKD9wFngs+BHYGuJYziWMqiscwgP8wLvBQ+AHUWURZle1mqhtXQAhLui7xZwPvgFsBENDg7+Drp069at2z09Pf03b978u6mpqZ+dVq1aFRAVFeW/aNGigNDQ0JfDwsISfXx8wowETBT+QpIPLsf0GpuomvrXIgUAPhhizoGXi+II+tq1az/o9fpLFRUVd8S26fJZWVkLN2/enBgTE/PW/PnzF5v0b0P5HSjxp0m9WXFaBQD+NYw6C1bf+vDwcF9DQ4N+/fr19ciPm0m1osLT01N76tSpNaD3PTw8FgpD+TXSoESrUGeWnVIBgM/EiDKwJ0eiPNrS0nJsw4YNNd3d3aOscxSFhIS4V1dXpyckJGRB5jxZ7jDSbVDiW7lslriY1cgVMvjjKErgR0dH/zl06NCuFStWfOdo8HwkZVL2wYMHP3ny5AlNLonPPi5jkSpMfyb9AhjAadMIlsBjrndmZ2fnnThxos9UwEyUMzIynj9y5EgB1gb3ExK/xBuTTSczBQCeC/ZnsDTnCR6f9YMbN25QiNMoOjras7W1tcjb2ztcfijXRKzpwjaaQgBPU0lrI4HntOGbdzZ4AuYzt2/fvm9sbOweyyBiOidjlCr4Y6QAyrTzkqlEx9GSkpJ9zpo2BGNKfHZRUdF+1D+W24iNGFVSpxAAcxekryK9/cuXLx/Foq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0pt7eXoe9Qcq1lRg3hRvNkLtyytuHfAHlKVOI+UIwQxYaRolramrSmZ8LhLefJIAnRmKVSFUAHbiq8yeqNRpGiWE5XlXKs5WWlZUthu3/SHh+voxVqlKnEEuYRvTPee5czjKjxDCr2bMVnYNF9IO7fRRQAokHxIuPeCig3t4YKcAeUCIYiRrcffjwYUd8fPyHzo6PwuJ4XL9+/QAWrjILOHWmDu5SAWjHa500sBSNZoibUWKGvNnuDOKbNwFPLLytITYjUteAWIuOvNbZptQxxF1ZWXnYGWuCc57TRnjzhMFbGmIyI7MpJPbAdMpEuQzsKdc/hi+jT0tLO+NoE0tTSWsjL9h58vP45qe8YppSAQqBEmaXfAy0MlbJcJ+tXqUMUMMdlpsUIuE78JYVO89mznn7LvmUh8gL+xzKknVS6hmrZLiPETNrr1npmNG3oXsg7LCKaFobx1yzKhKhBE3sFnA+mCFuI4IyBuyWzYjb/MHQh+lFN09SPIxgirxIlxhepeIWiHL41vPBFl90i4MtykOROfVXA4tAT9YJisyJP3tMu4gnA29aB2UY4V4DXg1m/FMH9gMrMSd6jwwe8PxtAPMU6JC/2/wHuyI2cMsNBRIAAAAASUVORK5CYII=);
}
.uni-audio-button.pause {
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAAAXNSR0IArs4c6QAABatJREFUaAXVWl1IpFUYnllZGUf3wlz6MXER1ES7s83VUDJw6KpdaSTDwMnYFSK6KNirooHullKQCNzQRjZ/wom1u9ALQ0mT1ktFdEBWXLdibaH1jwmx5zme83W+z2Hm+7bZmc8X3jl/73vO837n/z3j9aSBjo6O8lBNC7gZXAUuBxeCz4FJj8APwTHwCngaPOX1evcRZocAuhAcAt8G74KdEnWoyzpobGYIjfnBn4D/BqeLWBfr9Du1wmtXAZXnQPY9cBj8HNhEe3t7sbW1tfn19fW7m5ubD5aXl7dnZmYeUKipqel8dXV1UUlJyfmysrILFRUV9X6/n8PMSveREQYPYHgdWgsTpW0ZAPDP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YPZHoC94FW9gBJnEYZoa8SBy1hGNNuIWIiNg2PwKwbIPYDdhF9lZqgK6LEpA0fYv3PAHQF94IbCikdrcXFxWdVOtsh/abEpOG4ITGbvBI9EBA3f3qJo9FoUFPIapROX81zTYzEKkgNIQ8s4qwOH2d7PPQS9/T0vKjS2QqJQXqsFYSwxCrSpsmK6yVdi7zx0APmoVuvs7Pz/Wx55+jkHRoa+jonJ+cp4gHdAV+CAcbrjckASsCI0+vcpQGw7h6CVrDwRvMCTS8xvwbLM0Fsy+KZJha+1hCbiYw5oOdCkM86V1UejWBXZmJOsA22pXkeCIOvNAmfmk4MIQWaIYZTwiemYDAY3dracsUTU1IDpBGn95FP9Yac2KfzmVUzgkssHxfCYOGGR2gQvXp0jNG3lOyh+wKosrLykmWMq3q4SYXBth+6laLtEL3hqr8a2AZuFYQhrvizR8pJbAWeKA1j6OFuATeDq8D09hWClc+Jp0ceGHn/5hWWt8C0/N3mX15C4bDnCIuAAAAAAElFTkSuQmCC);
}
.uni-audio-right {
box-sizing: border-box;
height: 65px;
margin-left: 65px;
padding: 11px 16.5px 13.5px 15px;
overflow: hidden;
}
.uni-audio-time {
margin-top: 3.5px;
height: 16.5px;
font-size: 12px;
color: #888888;
float: right;
}
.uni-audio-info {
margin-right: 70px;
overflow: hidden;
}
.uni-audio-name {
height: 22.5px;
line-height: 22.5px;
margin-bottom: 3.5px;
font-size: 14px;
color: #353535;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.uni-audio-author {
height: 14.5px;
line-height: 14.5px;
font-size: 12px;
color: #888888;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
</style>
......@@ -157,273 +157,4 @@ export default {
'@label-click': '_onClick'
}
}
</script>
<style>
uni-button {
position: relative;
display: block;
margin-left: auto;
margin-right: auto;
padding-left: 14px;
padding-right: 14px;
box-sizing: border-box;
font-size: 18px;
text-align: center;
text-decoration: none;
line-height: 2.55555556;
border-radius: 5px;
-webkit-tap-highlight-color: transparent;
overflow: hidden;
color: #000000;
background-color: #f8f8f8;
cursor: pointer;
}
uni-button[hidden] {
display: none !important;
}
uni-button:after {
content: ' ';
width: 200%;
height: 200%;
position: absolute;
top: 0;
left: 0;
border: 1px solid rgba(0, 0, 0, 0.2);
-webkit-transform: scale(0.5);
transform: scale(0.5);
-webkit-transform-origin: 0 0;
transform-origin: 0 0;
box-sizing: border-box;
border-radius: 10px;
}
uni-button[native] {
padding-left: 0;
padding-right: 0;
}
uni-button[native] .uni-button-cover-view-wrapper {
border: inherit;
border-color: inherit;
border-radius: inherit;
background-color: inherit;
}
uni-button[native] .uni-button-cover-view-inner {
padding-left: 14px;
padding-right: 14px;
}
uni-button uni-cover-view {
line-height: inherit;
white-space: inherit;
}
uni-button[type='default'] {
color: #000000;
background-color: #f8f8f8;
}
uni-button[type='primary'] {
color: #ffffff;
background-color: #007aff;
}
uni-button[type='warn'] {
color: #ffffff;
background-color: #e64340;
}
uni-button[disabled] {
color: rgba(255, 255, 255, 0.6);
cursor: not-allowed;
}
uni-button[disabled][type='default'],
uni-button[disabled]:not([type]) {
color: rgba(0, 0, 0, 0.3);
background-color: #f7f7f7;
}
uni-button[disabled][type='primary'] {
background-color: rgba(0, 122, 255, 0.6);
}
uni-button[disabled][type='warn'] {
background-color: #ec8b89;
}
uni-button[type='primary'][plain] {
color: #007aff;
border: 1px solid #007aff;
background-color: transparent;
}
uni-button[type='primary'][plain][disabled] {
color: rgba(0, 0, 0, 0.2);
border-color: rgba(0, 0, 0, 0.2);
}
uni-button[type='primary'][plain]:after {
border-width: 0;
}
uni-button[type='default'][plain] {
color: #353535;
border: 1px solid #353535;
background-color: transparent;
}
uni-button[type='default'][plain][disabled] {
color: rgba(0, 0, 0, 0.2);
border-color: rgba(0, 0, 0, 0.2);
}
uni-button[type='default'][plain]:after {
border-width: 0;
}
uni-button[plain] {
color: #353535;
border: 1px solid #353535;
background-color: transparent;
}
uni-button[plain][disabled] {
color: rgba(0, 0, 0, 0.2);
border-color: rgba(0, 0, 0, 0.2);
}
uni-button[plain]:after {
border-width: 0;
}
uni-button[plain][native] .uni-button-cover-view-inner {
padding: 0;
}
uni-button[type='warn'][plain] {
color: #e64340;
border: 1px solid #e64340;
background-color: transparent;
}
uni-button[type='warn'][plain][disabled] {
color: rgba(0, 0, 0, 0.2);
border-color: rgba(0, 0, 0, 0.2);
}
uni-button[type='warn'][plain]:after {
border-width: 0;
}
uni-button[size='mini'] {
display: inline-block;
line-height: 2.3;
font-size: 13px;
padding: 0 1.34em;
}
uni-button[size='mini'][native] {
padding: 0;
}
uni-button[size='mini'][native] .uni-button-cover-view-inner {
padding: 0 1.34em;
}
uni-button[loading]:not([disabled]) {
cursor: progress;
}
uni-button[loading]:before {
content: ' ';
display: inline-block;
width: 18px;
height: 18px;
vertical-align: middle;
-webkit-animation: uni-loading 1s steps(12, end) infinite;
animation: uni-loading 1s steps(12, end) infinite;
background-size: 100%;
}
uni-button[loading][type='primary'] {
color: rgba(255, 255, 255, 0.6);
background-color: #0062cc;
}
uni-button[loading][type='primary'][plain] {
color: #007aff;
background-color: transparent;
}
uni-button[loading][type='default'] {
color: rgba(0, 0, 0, 0.6);
background-color: #dedede;
}
uni-button[loading][type='default'][plain] {
color: #353535;
background-color: transparent;
}
uni-button[loading][type='warn'] {
color: rgba(255, 255, 255, 0.6);
background-color: #ce3c39;
}
uni-button[loading][type='warn'][plain] {
color: #e64340;
background-color: transparent;
}
uni-button[loading][native]:before {
content: none;
}
.button-hover {
color: rgba(0, 0, 0, 0.6);
background-color: #dedede;
}
.button-hover[plain] {
color: rgba(53, 53, 53, 0.6);
border-color: rgba(53, 53, 53, 0.6);
background-color: transparent;
}
.button-hover[type='primary'] {
color: rgba(255, 255, 255, 0.6);
background-color: #0062cc;
}
.button-hover[type='primary'][plain] {
color: rgba(26, 173, 25, 0.6);
border-color: rgba(26, 173, 25, 0.6);
background-color: transparent;
}
.button-hover[type='default'] {
color: rgba(0, 0, 0, 0.6);
background-color: #dedede;
}
.button-hover[type='default'][plain] {
color: rgba(53, 53, 53, 0.6);
border-color: rgba(53, 53, 53, 0.6);
background-color: transparent;
}
.button-hover[type='warn'] {
color: rgba(255, 255, 255, 0.6);
background-color: #ce3c39;
}
.button-hover[type='warn'][plain] {
color: rgba(230, 67, 64, 0.6);
border-color: rgba(230, 67, 64, 0.6);
background-color: transparent;
}
</style>
</script>
\ No newline at end of file
......@@ -95,71 +95,4 @@ export default {
}
}
}
</script>
<style>
uni-checkbox {
-webkit-tap-highlight-color: transparent;
display: inline-block;
cursor: pointer;
}
uni-checkbox[hidden] {
display: none;
}
uni-checkbox[disabled] {
cursor: not-allowed;
}
uni-checkbox .uni-checkbox-wrapper {
display: -webkit-inline-flex;
display: inline-flex;
-webkit-align-items: center;
align-items: center;
vertical-align: middle;
}
uni-checkbox .uni-checkbox-input {
margin-right: 5px;
-webkit-appearance: none;
appearance: none;
outline: 0;
border: 1px solid #D1D1D1;
background-color: #FFFFFF;
border-radius: 3px;
width: 22px;
height: 22px;
position: relative;
}
uni-checkbox:not([disabled]) .uni-checkbox-input:hover {
border-color: #007aff;
}
uni-checkbox .uni-checkbox-input.uni-checkbox-input-checked {
color: #007aff;
}
uni-checkbox .uni-checkbox-input.uni-checkbox-input-checked:before {
font: normal normal normal 14px/1 "uni";
content: "\EA08";
font-size: 22px;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -48%) scale(0.73);
-webkit-transform: translate(-50%, -48%) scale(0.73);
}
uni-checkbox .uni-checkbox-input.uni-checkbox-input-disabled {
background-color: #E1E1E1;
}
uni-checkbox .uni-checkbox-input.uni-checkbox-input-disabled:before {
color: #ADADAD;
}
uni-checkbox-group {
display: block;
}
</style>
</script>
\ No newline at end of file
......@@ -125,33 +125,3 @@ export default {
}
}
</script>
<style>
uni-progress {
display: -webkit-flex;
display: flex;
-webkit-align-items: center;
align-items: center;
}
uni-progress[hidden] {
display: none;
}
.uni-progress-bar {
-webkit-flex: 1;
flex: 1;
}
.uni-progress-inner-bar {
width: 0;
height: 100%;
}
.uni-progress-info {
margin-top: 0;
margin-bottom: 0;
min-width: 2em;
margin-left: 15px;
font-size: 16px;
}
</style>
......@@ -206,93 +206,3 @@ export default {
}
}
</script>
<style>
uni-slider {
margin: 10px 18px;
padding: 0;
display: block;
}
uni-slider[hidden] {
display: none;
}
uni-slider .uni-slider-wrapper {
display: -webkit-flex;
display: flex;
-webkit-align-items: center;
align-items: center;
min-height: 16px;
}
uni-slider .uni-slider-tap-area {
-webkit-flex: 1;
flex: 1;
padding: 8px 0;
}
uni-slider .uni-slider-handle-wrapper {
position: relative;
height: 2px;
border-radius: 5px;
background-color: #e9e9e9;
cursor: pointer;
transition: background-color 0.3s ease;
-webkit-tap-highlight-color: transparent;
}
uni-slider .uni-slider-track {
height: 100%;
border-radius: 6px;
background-color: #007aff;
transition: background-color 0.3s ease;
}
uni-slider .uni-slider-handle,
uni-slider .uni-slider-thumb {
position: absolute;
left: 50%;
top: 50%;
cursor: pointer;
border-radius: 50%;
transition: border-color 0.3s ease;
}
uni-slider .uni-slider-handle {
width: 28px;
height: 28px;
margin-top: -14px;
margin-left: -14px;
background-color: transparent;
z-index: 3;
cursor: grab;
}
uni-slider .uni-slider-thumb {
z-index: 2;
box-shadow: 0 0 4px rgba(0, 0, 0, 0.2);
}
uni-slider .uni-slider-step {
position: absolute;
width: 100%;
height: 2px;
background: transparent;
z-index: 1;
}
uni-slider .uni-slider-value {
color: #888;
font-size: 14px;
margin-left: 1em;
}
uni-slider .uni-slider-disabled .uni-slider-track {
background-color: #ccc;
}
uni-slider .uni-slider-disabled .uni-slider-thumb {
background-color: #FFF;
border-color: #ccc;
}
</style>
uni-audio {
display: none;
}
uni-audio[controls] {
display: inline-block;
}
uni-audio[hidden] {
display: none;
}
.uni-audio-default {
max-width: 100%;
min-width: 302px;
height: 65px;
background: #fcfcfc;
border: 1px solid #e0e0e0;
border-radius: 2.5px;
display: inline-block;
overflow: hidden;
}
.uni-audio-left {
width: 65px;
height: 65px;
float: left;
background-color: #e6e6e6;
background-size: 100% 100%;
background-position: 50% 50%;
}
.uni-audio-button {
width: 24px;
height: 24px;
margin: 20.5px;
background-size: cover;
}
.uni-audio-button.play {
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAAAXNSR0IArs4c6QAAB4dJREFUaAXNWg1MlVUYvpcfIRCJ+MnCaOBl8dOcOCEQZ9kmI5cQG5Yb6MifKbMaGVobOtlibTWHDpgpxBUwF07826iFsMkYJhg559JdGiQSkUzSBA0QkZ7n4/u+nXsvwf3jwru99/y/3/N+3znvec97rlbjABofH38GYtaAV4MjwDqwH9gHTBoE3wd3gA3gi+B6rVY7hHR2CKD9wFngs+BHYGuJYziWMqiscwgP8wLvBQ+AHUWURZle1mqhtXQAhLui7xZwPvgFsBENDg7+Drp069at2z09Pf03b978u6mpqZ+dVq1aFRAVFeW/aNGigNDQ0JfDwsISfXx8wowETBT+QpIPLsf0GpuomvrXIgUAPhhizoGXi+II+tq1az/o9fpLFRUVd8S26fJZWVkLN2/enBgTE/PW/PnzF5v0b0P5HSjxp0m9WXFaBQD+NYw6C1bf+vDwcF9DQ4N+/fr19ciPm0m1osLT01N76tSpNaD3PTw8FgpD+TXSoESrUGeWnVIBgM/EiDKwJ0eiPNrS0nJsw4YNNd3d3aOscxSFhIS4V1dXpyckJGRB5jxZ7jDSbVDiW7lslriY1cgVMvjjKErgR0dH/zl06NCuFStWfOdo8HwkZVL2wYMHP3ny5AlNLonPPi5jkSpMfyb9AhjAadMIlsBjrndmZ2fnnThxos9UwEyUMzIynj9y5EgB1gb3ExK/xBuTTSczBQCeC/ZnsDTnCR6f9YMbN25QiNMoOjras7W1tcjb2ztcfijXRKzpwjaaQgBPU0lrI4HntOGbdzZ4AuYzt2/fvm9sbOweyyBiOidjlCr4Y6QAyrTzkqlEx9GSkpJ9zpo2BGNKfHZRUdF+1D+W24iNGFVSpxAAcxekryK9/cuXLx/FoqpWe85iBlPpvbi4uB0yBE4lHabSv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yytuHfAHlKVOI+UIwQxYaRolramrSmZ8LhLefJIAnRmKVSFUAHbiq8yeqNRpGiWE5XlXKs5WWlZUthu3/SHh+voxVqlKnEEuYRvTPee5czjKjxDCr2bMVnYNF9IO7fRRQAokHxIuPeCig3t4YKcAeUCIYiRrcffjwYUd8fPyHzo6PwuJ4XL9+/QAWrjILOHWmDu5SAWjHa500sBSNZoibUWKGvNnuDOKbNwFPLLytITYjUteAWIuOvNbZptQxxF1ZWXnYGWuCc57TRnjzhMFbGmIyI7MpJPbAdMpEuQzsKdc/hi+jT0tLO+NoE0tTSWsjL9h58vP45qe8YppSAQqBEmaXfAy0MlbJcJ+tXqUMUMMdlpsUIuE78JYVO89mznn7LvmUh8gL+xzKknVS6hmrZLiPETNrr1npmNG3oXsg7LCKaFobx1yzKhKhBE3sFnA+mCFuI4IyBuyWzYjb/MHQh+lFN09SPIxgirxIlxhepeIWiHL41vPBFl90i4MtykOROfVXA4tAT9YJisyJP3tMu4gnA29aB2UY4V4DXg1m/FMH9gMrMSd6jwwe8PxtAPMU6JC/2/wHuyI2cMsNBRIAAAAASUVORK5CYII=);
}
.uni-audio-button.pause {
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAAAXNSR0IArs4c6QAABatJREFUaAXVWl1IpFUYnllZGUf3wlz6MXER1ES7s83VUDJw6KpdaSTDwMnYFSK6KNirooHullKQCNzQRjZ/wom1u9ALQ0mT1ktFdEBWXLdibaH1jwmx5zme83W+z2Hm+7bZmc8X3jl/73vO837n/z3j9aSBjo6O8lBNC7gZXAUuBxeCz4FJj8APwTHwCngaPOX1evcRZocAuhAcAt8G74KdEnWoyzpobGYIjfnBn4D/BqeLWBfr9Du1wmtXAZXnQPY9cBj8HNhEe3t7sbW1tfn19fW7m5ubD5aXl7dnZmYeUKipqel8dXV1UUlJyfmysrILFRUV9X6/n8PMSveREQYPYHgdWgsTpW0ZAPDPQ3kC/JJeCUEvLi7+NDg4+EskE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GNNuIWIiNg2PwKwbIPYDdhF9lZqgK6LEpA0fYv3PAHQF94IbCikdrcXFxWdVOtsh/abEpOG4ITGbvBI9EBA3f3qJo9FoUFPIapROX81zTYzEKkgNIQ8s4qwOH2d7PPQS9/T0vKjS2QqJQXqsFYSwxCrSpsmK6yVdi7zx0APmoVuvs7Pz/Wx55+jkHRoa+jonJ+cp4gHdAV+CAcbrjckASsCI0+vcpQGw7h6CVrDwRvMCTS8xvwbLM0Fsy+KZJha+1hCbiYw5oOdCkM86V1UejWBXZmJOsA22pXkeCIOvNAmfmk4MIQWaIYZTwiemYDAY3dracsUTU1IDpBGn95FP9Yac2KfzmVUzgkssHxfCYOGGR2gQvXp0jNG3lOyh+wKosrLykmWMq3q4SYXBth+6laLtEL3hqr8a2AZuFYQhrvizR8pJbAWeKA1j6OFuATeDq8D09hWClc+Jp0ceGHn/5hWWt8C0/N3mX15C4bDnCIuAAAAAAElFTkSuQmCC);
}
.uni-audio-right {
box-sizing: border-box;
height: 65px;
margin-left: 65px;
padding: 11px 16.5px 13.5px 15px;
overflow: hidden;
}
.uni-audio-time {
margin-top: 3.5px;
height: 16.5px;
font-size: 12px;
color: #888888;
float: right;
}
.uni-audio-info {
margin-right: 70px;
overflow: hidden;
}
.uni-audio-name {
height: 22.5px;
line-height: 22.5px;
margin-bottom: 3.5px;
font-size: 14px;
color: #353535;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.uni-audio-author {
height: 14.5px;
line-height: 14.5px;
font-size: 12px;
color: #888888;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
......@@ -7,6 +7,7 @@ export default {
root: '.',
minify: false,
assetsDir: '.',
emitAssets: false,
define: {
__PLATFORM__: JSON.stringify('app-plus')
},
......@@ -28,33 +29,4 @@ export default {
return 'assets/[name]-[hash][extname]'
}
}
// configureBuild: buildComponents
}
const components = fs
.readdirSync(path.resolve(__dirname, 'src/components'))
.filter(item => !/(^|\/)\.[^/.]/g.test(item))
function buildComponents(_config, builds) {
return once(() => {
const mainBuild = builds[0]
components.forEach(name => {
builds.push({
// eslint-disabled no-restricted-syntax
...mainBuild,
input: `src/components/${name}/index.vue`,
output: {
dir: `dist/${name}`,
file: `${name}.js`
},
plugins: [...mainBuild.plugins]
})
})
console.log('builds.length', builds.length)
})
}
function once(fn) {
let called = false
return () => (!called && fn(), (called = true))
}
此差异已折叠。
此差异已折叠。
* {
margin: 0;
-webkit-tap-highlight-color: transparent;
}
@font-face {
font-weight: normal;
font-style: normal;
font-family: 'uni';
src: url('data:application/octet-stream;base64,AAEAAAALAIAAAwAwR1NVQrD+s+0AAAE4AAAAQk9TLzJAKEx+AAABfAAAAFZjbWFw65cFHQAAAhwAAAJQZ2x5ZvCRR/EAAASUAAAKtGhlYWQLKIN9AAAA4AAAADZoaGVhCCwD+gAAALwAAAAkaG10eEJo//8AAAHUAAAASGxvY2EYqhW6AAAEbAAAACZtYXhwASEAVQAAARgAAAAgbmFtZeNcHtgAAA9IAAAB5nBvc3T6bLhLAAARMAAAAOYAAQAAA+gAAABaA+j/////A+kAAQAAAAAAAAAAAAAAAAAAABIAAQAAAAEAACkCj3dfDzz1AAsD6AAAAADUER9XAAAAANQRH1f//wAAA+kD6gAAAAgAAgAAAAAAAAABAAAAEgBJAAUAAAAAAAIAAAAKAAoAAAD/AAAAAAAAAAEAAAAKAB4ALAABREZMVAAIAAQAAAAAAAAAAQAAAAFsaWdhAAgAAAABAAAAAQAEAAQAAAABAAgAAQAGAAAAAQAAAAAAAQOwAZAABQAIAnoCvAAAAIwCegK8AAAB4AAxAQIAAAIABQMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUGZFZABA6gHqEQPoAAAAWgPqAAAAAAABAAAAAAAAAAAAAAPoAAAD6AAAA+gAAAPoAAAD6AAAA+gAAAPoAAAD6AAAA+gAAAPoAAAD6AAAA+gAAAPoAAAD6AAAA+j//wPoAAAD6AAAAAAABQAAAAMAAAAsAAAABAAAAXQAAQAAAAAAbgADAAEAAAAsAA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XJjbGUHd2FpdGluZw53YWl0aW5nLWNpcmNsZQR3YXJuC2luZm8tY2lyY2xlBmNhbmNlbAZzZWFyY2gFY2xlYXIEYmFjawZkZWxldGUAAAAA')
format('truetype');
}
@font-face {
font-weight: normal;
font-style: normal;
font-family: 'unibtn';
src: url('data:application/octet-stream;base64,AAEAAAAKAIAAAwAgT1MvMvUTHSwAAACsAAAAYGNtYXD/1LSBAAABDAAAAVpnbHlmz06L9gAAAmgAAAQ0aGVhZA501cwAAAacAAAANmhoZWEH7wQ6AAAG1AAAACRobXR4JCoHAwAABvgAAAAkbG9jYQQeBSgAAAccAAAAFG1heHAADQBLAAAHMAAAACBuYW1l5hEPkgAAB1AAAAHacG9zdAQfBCEAAAksAAAAPAAEBAUBkAAFAAACmQLMAAAAjwKZAswAAAHrADMBCQAAAAAAAAAAAAAAAAAAAAEQAAAAAAAAAAAAAAAAAAAAAEDmAP/9A8D/wABAA8AAQAAAAAEAAAAAAAAAAAAAACAAAAAAAAMAAAADAAAAHAABAAAAAABUAAMAAQAAABwABAA4AAAACgAIAAIAAuYC5gbmUf/9//8AAOYA5gTmUP/9//8aARoAGbcAAwABAAAAAAAAAAAAAAAAAQYAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAWAAeQLBAuoAFQAAASY0NzYyFwEeARUUBgcBBiInJjQ3AQFgCAgHFgcBNQQEBAT+ywc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AGMAbwBuAGYAbwBuAHQARgBvAG4AdAAgAGcAZQBuAGUAcgBhAHQAZQBkACAAYgB5ACAASQBjAG8ATQBvAG8AbgAuAAAAAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACQAJAAABAgEDAQQBBQEGAQcBCAEJAAAAAAAAAAA=')
format('truetype');
}
html,
body {
-webkit-user-select: none;
user-select: none;
width: 100%;
height: 100%;
}
/* html {
height: 100%
} */
body {
overflow-x: hidden;
}
[class^='uni-icon-'],
[class*=' uni-icon-'] {
display: inline-block;
vertical-align: middle;
font: normal normal normal 14px/1 'uni';
font-size: inherit;
text-rendering: auto;
-webkit-font-smoothing: antialiased;
}
[class^='uni-btn-icon'],
[class*=' uni-btn-icon'] {
display: inline-block;
font: normal normal normal 14px/1 'unibtn';
font-size: inherit;
text-rendering: auto;
-webkit-font-smoothing: antialiased;
}
[class^='uni-btn-icon']:before,
[class*=' uni-btn-icon']:before {
margin: 0;
box-sizing: border-box;
}
.uni-icon-success-no-circle:before {
content: '\EA08';
}
.uni-loading,
uni-button[loading]:before {
background: transparent
url('data:image/svg+xml;base64, PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMjAiIGhlaWdodD0iMTIwIiB2aWV3Qm94PSIwIDAgMTAwIDEwMCI+PHBhdGggZmlsbD0ibm9uZSIgZD0iTTAgMGgxMDB2MTAwSDB6Ii8+PHJlY3Qgd2lkdGg9IjciIGhlaWdodD0iMjAiIHg9IjQ2LjUiIHk9IjQwIiBmaWxsPSIjRTlFOUU5IiByeD0iNSIgcnk9IjUiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDAgLTMwKSIvPjxyZWN0IHdpZHRoPSI3IiBoZWlnaHQ9IjIwIiB4PSI0Ni41IiB5PSI0MCIgZmlsbD0iIzk4OTY5NyIgcng9IjUiIHJ5PSI1IiB0cmFuc2Zvcm09InJvdGF0ZSgzMCAxMDUuOTggNjUpIi8+PHJlY3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DYuNSIgeT0iNDAiIGZpbGw9IiNEMkQyRDIiIHJ4PSI1IiByeT0iNSIgdHJhbnNmb3JtPSJyb3RhdGUoLTkwIDM1IDY1KSIvPjxyZWN0IHdpZHRoPSI3IiBoZWlnaHQ9IjIwIiB4PSI0Ni41IiB5PSI0MCIgZmlsbD0iI0RBREFEQSIgcng9IjUiIHJ5PSI1IiB0cmFuc2Zvcm09InJvdGF0ZSgtNjAgMjQuMDIgNjUpIi8+PHJlY3Qgd2lkdGg9IjciIGhlaWdodD0iMjAiIHg9IjQ2LjUiIHk9IjQwIiBmaWxsPSIjRTJFMkUyIiByeD0iNSIgcnk9IjUiIHRyYW5zZm9ybT0icm90YXRlKC0zMCAtNS45OCA2NSkiLz48L3N2Zz4=')
no-repeat;
}
.uni-loading {
width: 20px;
height: 20px;
display: inline-block;
vertical-align: middle;
animation: uni-loading 1s steps(12, end) infinite;
background-size: 100%;
}
@keyframes uni-loading {
0% {
transform: rotate3d(0, 0, 1, 0deg);
}
100% {
transform: rotate3d(0, 0, 1, 360deg);
}
}
/*
html,
body,
uni-app,
uni-page {
height: 100%;
} */
.uni-mask {
position: fixed;
z-index: 999;
top: 0;
right: 0;
left: 0;
bottom: 0;
background: rgba(0, 0, 0, 0.5);
}
.uni-fade-enter-active,
.uni-fade-leave-active {
transition-duration: 0.25s;
transition-property: opacity;
transition-timing-function: ease;
}
.uni-fade-enter,
.uni-fade-leave-active {
opacity: 0;
}
[nvue] uni-view,
[nvue] uni-label,
[nvue] uni-swiper-item,
[nvue] uni-scroll-view {
display: flex;
flex-shrink: 0;
flex-grow: 0;
flex-basis: auto;
align-items: stretch;
align-content: flex-start;
}
[nvue] uni-button {
margin: 0;
}
[nvue-dir-row] uni-view,
[nvue-dir-row] uni-label,
[nvue-dir-row] uni-swiper-item {
flex-direction: row;
}
[nvue-dir-column] uni-view,
[nvue-dir-column] uni-label,
[nvue-dir-column] uni-swiper-item {
flex-direction: column;
}
[nvue-dir-row-reverse] uni-view,
[nvue-dir-row-reverse] uni-label,
[nvue-dir-row-reverse] uni-swiper-item {
flex-direction: row-reverse;
}
[nvue-dir-column-reverse] uni-view,
[nvue-dir-column-reverse] uni-label,
[nvue-dir-column-reverse] uni-swiper-item {
flex-direction: column-reverse;
}
[nvue] uni-view,
[nvue] uni-image,
[nvue] uni-input,
[nvue] uni-scroll-view,
[nvue] uni-swiper,
[nvue] uni-swiper-item,
[nvue] uni-text,
[nvue] uni-textarea,
[nvue] uni-video {
position: relative;
border: 0px solid #000000;
box-sizing: border-box;
}
[nvue] uni-swiper-item {
position: absolute;
}
@import './base.css';
uni-button {
position: relative;
display: block;
margin-left: auto;
margin-right: auto;
padding-left: 14px;
padding-right: 14px;
box-sizing: border-box;
font-size: 18px;
text-align: center;
text-decoration: none;
line-height: 2.55555556;
border-radius: 5px;
-webkit-tap-highlight-color: transparent;
overflow: hidden;
color: #000000;
background-color: #f8f8f8;
cursor: pointer;
}
uni-button[hidden] {
display: none !important;
}
uni-button:after {
content: ' ';
width: 200%;
height: 200%;
position: absolute;
top: 0;
left: 0;
border: 1px solid rgba(0, 0, 0, 0.2);
-webkit-transform: scale(0.5);
transform: scale(0.5);
-webkit-transform-origin: 0 0;
transform-origin: 0 0;
box-sizing: border-box;
border-radius: 10px;
}
uni-button[native] {
padding-left: 0;
padding-right: 0;
}
uni-button[native] .uni-button-cover-view-wrapper {
border: inherit;
border-color: inherit;
border-radius: inherit;
background-color: inherit;
}
uni-button[native] .uni-button-cover-view-inner {
padding-left: 14px;
padding-right: 14px;
}
uni-button uni-cover-view {
line-height: inherit;
white-space: inherit;
}
uni-button[type='default'] {
color: #000000;
background-color: #f8f8f8;
}
uni-button[type='primary'] {
color: #ffffff;
background-color: #007aff;
}
uni-button[type='warn'] {
color: #ffffff;
background-color: #e64340;
}
uni-button[disabled] {
color: rgba(255, 255, 255, 0.6);
cursor: not-allowed;
}
uni-button[disabled][type='default'],
uni-button[disabled]:not([type]) {
color: rgba(0, 0, 0, 0.3);
background-color: #f7f7f7;
}
uni-button[disabled][type='primary'] {
background-color: rgba(0, 122, 255, 0.6);
}
uni-button[disabled][type='warn'] {
background-color: #ec8b89;
}
uni-button[type='primary'][plain] {
color: #007aff;
border: 1px solid #007aff;
background-color: transparent;
}
uni-button[type='primary'][plain][disabled] {
color: rgba(0, 0, 0, 0.2);
border-color: rgba(0, 0, 0, 0.2);
}
uni-button[type='primary'][plain]:after {
border-width: 0;
}
uni-button[type='default'][plain] {
color: #353535;
border: 1px solid #353535;
background-color: transparent;
}
uni-button[type='default'][plain][disabled] {
color: rgba(0, 0, 0, 0.2);
border-color: rgba(0, 0, 0, 0.2);
}
uni-button[type='default'][plain]:after {
border-width: 0;
}
uni-button[plain] {
color: #353535;
border: 1px solid #353535;
background-color: transparent;
}
uni-button[plain][disabled] {
color: rgba(0, 0, 0, 0.2);
border-color: rgba(0, 0, 0, 0.2);
}
uni-button[plain]:after {
border-width: 0;
}
uni-button[plain][native] .uni-button-cover-view-inner {
padding: 0;
}
uni-button[type='warn'][plain] {
color: #e64340;
border: 1px solid #e64340;
background-color: transparent;
}
uni-button[type='warn'][plain][disabled] {
color: rgba(0, 0, 0, 0.2);
border-color: rgba(0, 0, 0, 0.2);
}
uni-button[type='warn'][plain]:after {
border-width: 0;
}
uni-button[size='mini'] {
display: inline-block;
line-height: 2.3;
font-size: 13px;
padding: 0 1.34em;
}
uni-button[size='mini'][native] {
padding: 0;
}
uni-button[size='mini'][native] .uni-button-cover-view-inner {
padding: 0 1.34em;
}
uni-button[loading]:not([disabled]) {
cursor: progress;
}
uni-button[loading]:before {
content: ' ';
display: inline-block;
width: 18px;
height: 18px;
vertical-align: middle;
-webkit-animation: uni-loading 1s steps(12, end) infinite;
animation: uni-loading 1s steps(12, end) infinite;
background-size: 100%;
}
uni-button[loading][type='primary'] {
color: rgba(255, 255, 255, 0.6);
background-color: #0062cc;
}
uni-button[loading][type='primary'][plain] {
color: #007aff;
background-color: transparent;
}
uni-button[loading][type='default'] {
color: rgba(0, 0, 0, 0.6);
background-color: #dedede;
}
uni-button[loading][type='default'][plain] {
color: #353535;
background-color: transparent;
}
uni-button[loading][type='warn'] {
color: rgba(255, 255, 255, 0.6);
background-color: #ce3c39;
}
uni-button[loading][type='warn'][plain] {
color: #e64340;
background-color: transparent;
}
uni-button[loading][native]:before {
content: none;
}
.button-hover {
color: rgba(0, 0, 0, 0.6);
background-color: #dedede;
}
.button-hover[plain] {
color: rgba(53, 53, 53, 0.6);
border-color: rgba(53, 53, 53, 0.6);
background-color: transparent;
}
.button-hover[type='primary'] {
color: rgba(255, 255, 255, 0.6);
background-color: #0062cc;
}
.button-hover[type='primary'][plain] {
color: rgba(26, 173, 25, 0.6);
border-color: rgba(26, 173, 25, 0.6);
background-color: transparent;
}
.button-hover[type='default'] {
color: rgba(0, 0, 0, 0.6);
background-color: #dedede;
}
.button-hover[type='default'][plain] {
color: rgba(53, 53, 53, 0.6);
border-color: rgba(53, 53, 53, 0.6);
background-color: transparent;
}
.button-hover[type='warn'] {
color: rgba(255, 255, 255, 0.6);
background-color: #ce3c39;
}
.button-hover[type='warn'][plain] {
color: rgba(230, 67, 64, 0.6);
border-color: rgba(230, 67, 64, 0.6);
background-color: transparent;
}
@import './base.css';
uni-checkbox {
-webkit-tap-highlight-color: transparent;
display: inline-block;
cursor: pointer;
}
uni-checkbox[hidden] {
display: none;
}
uni-checkbox[disabled] {
cursor: not-allowed;
}
uni-checkbox .uni-checkbox-wrapper {
display: -webkit-inline-flex;
display: inline-flex;
-webkit-align-items: center;
align-items: center;
vertical-align: middle;
}
uni-checkbox .uni-checkbox-input {
margin-right: 5px;
-webkit-appearance: none;
appearance: none;
outline: 0;
border: 1px solid #d1d1d1;
background-color: #ffffff;
border-radius: 3px;
width: 22px;
height: 22px;
position: relative;
}
uni-checkbox:not([disabled]) .uni-checkbox-input:hover {
border-color: #007aff;
}
uni-checkbox .uni-checkbox-input.uni-checkbox-input-checked {
color: #007aff;
}
uni-checkbox .uni-checkbox-input.uni-checkbox-input-checked:before {
font: normal normal normal 14px/1 'uni';
content: '\EA08';
font-size: 22px;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -48%) scale(0.73);
-webkit-transform: translate(-50%, -48%) scale(0.73);
}
uni-checkbox .uni-checkbox-input.uni-checkbox-input-disabled {
background-color: #e1e1e1;
}
uni-checkbox .uni-checkbox-input.uni-checkbox-input-disabled:before {
color: #adadad;
}
uni-checkbox-group {
display: block;
}
uni-progress {
display: -webkit-flex;
display: flex;
-webkit-align-items: center;
align-items: center;
}
uni-progress[hidden] {
display: none;
}
.uni-progress-bar {
-webkit-flex: 1;
flex: 1;
}
.uni-progress-inner-bar {
width: 0;
height: 100%;
}
.uni-progress-info {
margin-top: 0;
margin-bottom: 0;
min-width: 2em;
margin-left: 15px;
font-size: 16px;
}
uni-slider {
margin: 10px 18px;
padding: 0;
display: block;
}
uni-slider[hidden] {
display: none;
}
uni-slider .uni-slider-wrapper {
display: -webkit-flex;
display: flex;
-webkit-align-items: center;
align-items: center;
min-height: 16px;
}
uni-slider .uni-slider-tap-area {
-webkit-flex: 1;
flex: 1;
padding: 8px 0;
}
uni-slider .uni-slider-handle-wrapper {
position: relative;
height: 2px;
border-radius: 5px;
background-color: #e9e9e9;
cursor: pointer;
transition: background-color 0.3s ease;
-webkit-tap-highlight-color: transparent;
}
uni-slider .uni-slider-track {
height: 100%;
border-radius: 6px;
background-color: #007aff;
transition: background-color 0.3s ease;
}
uni-slider .uni-slider-handle,
uni-slider .uni-slider-thumb {
position: absolute;
left: 50%;
top: 50%;
cursor: pointer;
border-radius: 50%;
transition: border-color 0.3s ease;
}
uni-slider .uni-slider-handle {
width: 28px;
height: 28px;
margin-top: -14px;
margin-left: -14px;
background-color: transparent;
z-index: 3;
cursor: grab;
}
uni-slider .uni-slider-thumb {
z-index: 2;
box-shadow: 0 0 4px rgba(0, 0, 0, 0.2);
}
uni-slider .uni-slider-step {
position: absolute;
width: 100%;
height: 2px;
background: transparent;
z-index: 1;
}
uni-slider .uni-slider-value {
color: #888;
font-size: 14px;
margin-left: 1em;
}
uni-slider .uni-slider-disabled .uni-slider-track {
background-color: #ccc;
}
uni-slider .uni-slider-disabled .uni-slider-thumb {
background-color: #fff;
border-color: #ccc;
}
......@@ -12,11 +12,12 @@ export default {
root: '.',
minify: false,
assetsDir: '.',
cssCodeSplit: true,
emitAssets: false,
alias: {
'@dcloudio/uni-api': resolve('../uni-api/src/index.ts'),
'@dcloudio/uni-vue': resolve('../uni-vue/src/index.ts'),
'@dcloudio/uni-core': resolve('../uni-core/src/index.ts')
'@dcloudio/uni-core': resolve('../uni-core/src/index.ts'),
'@dcloudio/uni-components': resolve('../uni-components/src/index.ts')
},
define: {
global: 'window',
......@@ -28,13 +29,7 @@ export default {
},
rollupInputOptions: {
input: 'src/index.ts',
external: [
'vue',
'vue-router',
'@vue/shared',
'@dcloudio/uni-shared',
'@dcloudio/uni-components'
],
external: ['vue', 'vue-router', '@vue/shared', '@dcloudio/uni-shared'],
preserveEntrySignatures: 'strict',
plugins: [
replace({
......
......@@ -33,7 +33,7 @@ describe('hooks', () => {
const mpOptions: any = {}
initHooks(mpOptions, ['onReady'])
initUnknownHooks(mpOptions, vueBasicOptions)
expect(mpOptions.onReady).toBeDefined()
expect(mpOptions.onReady).toBeUndefined()
expect(mpOptions.onLoad).toBeDefined()
})
test('extends', () => {
......@@ -53,7 +53,7 @@ describe('hooks', () => {
const mpOptions: any = {}
initUnknownHooks(mpOptions, vueExtendsANdMixinsOptions)
expect(mpOptions.onLoad).toBeDefined()
expect(mpOptions.onReady).toBeDefined()
expect(mpOptions.onReady).toBeUndefined()
expect(mpOptions.onShow).toBeDefined()
expect(mpOptions.onHide).toBeDefined()
})
......
......@@ -119,15 +119,21 @@ function isBuiltInComponent(tag) {
}
function isCustomElement(tag) {
return TAGS.indexOf(tag) !== -1 || BUILT_IN_TAGS.indexOf(tag) !== -1;
}
}
function isNativeTag(tag) {
return (shared.isHTMLTag(tag) || shared.isSVGTag(tag)) && !isBuiltInComponent(tag);
}
const COMPONENT_PREFIX = 'v-uni-';
exports.BUILT_IN_TAGS = BUILT_IN_TAGS;
exports.COMPONENT_NAME_PREFIX = COMPONENT_NAME_PREFIX;
exports.COMPONENT_PREFIX = COMPONENT_PREFIX;
exports.NAVBAR_HEIGHT = NAVBAR_HEIGHT;
exports.TABBAR_HEIGHT = TABBAR_HEIGHT;
exports.TAGS = TAGS;
exports.debounce = debounce;
exports.isBuiltInComponent = isBuiltInComponent;
exports.isCustomElement = isCustomElement;
exports.isNativeTag = isNativeTag;
exports.plusReady = plusReady;
exports.stringifyQuery = stringifyQuery;
......@@ -3,6 +3,8 @@ export declare const BUILT_IN_TAGS: string[];
export declare const COMPONENT_NAME_PREFIX = "VUni";
export declare const COMPONENT_PREFIX = "v-uni-";
export declare function debounce(fn: Function, delay: number): {
(this: any): void;
cancel(): void;
......@@ -12,6 +14,8 @@ export declare function isBuiltInComponent(tag: string): boolean;
export declare function isCustomElement(tag: string): boolean;
export declare function isNativeTag(tag: string): boolean;
export declare const NAVBAR_HEIGHT = 44;
export declare function plusReady(callback: () => void): void;
......
import { isPlainObject } from '@vue/shared';
import { isPlainObject, isHTMLTag, isSVGTag } from '@vue/shared';
const NAVBAR_HEIGHT = 44;
const TABBAR_HEIGHT = 50;
......@@ -115,6 +115,10 @@ function isBuiltInComponent(tag) {
}
function isCustomElement(tag) {
return TAGS.indexOf(tag) !== -1 || BUILT_IN_TAGS.indexOf(tag) !== -1;
}
}
function isNativeTag(tag) {
return (isHTMLTag(tag) || isSVGTag(tag)) && !isBuiltInComponent(tag);
}
const COMPONENT_PREFIX = 'v-uni-';
export { BUILT_IN_TAGS, COMPONENT_NAME_PREFIX, NAVBAR_HEIGHT, TABBAR_HEIGHT, TAGS, debounce, isBuiltInComponent, isCustomElement, plusReady, stringifyQuery };
export { BUILT_IN_TAGS, COMPONENT_NAME_PREFIX, COMPONENT_PREFIX, NAVBAR_HEIGHT, TABBAR_HEIGHT, TAGS, debounce, isBuiltInComponent, isCustomElement, isNativeTag, plusReady, stringifyQuery };
import { isHTMLTag, isSVGTag } from '@vue/shared'
export const BUILT_IN_TAGS = [
'uni-ad',
'uni-audio',
......@@ -70,3 +72,9 @@ export function isBuiltInComponent(tag: string) {
export function isCustomElement(tag: string) {
return TAGS.indexOf(tag) !== -1 || BUILT_IN_TAGS.indexOf(tag) !== -1
}
export function isNativeTag(tag: string) {
return (isHTMLTag(tag) || isSVGTag(tag)) && !isBuiltInComponent(tag)
}
export const COMPONENT_PREFIX = 'v-uni-'
......@@ -21,13 +21,13 @@
},
"license": "Apache-2.0",
"dependencies": {
"@dcloudio/uni-cli-shared": "^3.0.0",
"@rollup/pluginutils": "^4.1.0",
"estree-walker": "^2.0.1",
"magic-string": "^0.25.7",
"slash": "^3.0.0"
},
"peerDependencies": {
"vite": "^1.0.0-rc.4"
"@dcloudio/uni-cli-shared": "^3.0.0",
"vite": "^1.0.0-rc.12"
}
}
import { serverPluginMainJs, serverPluginPagesJson } from '../server'
export const configureServer = [serverPluginMainJs, serverPluginPagesJson]
export const define = {
__UNI_WX_API__: true,
__UNI_WXS_API__: true,
__UNI_ROUTER_MODE__: JSON.stringify('hash')
}
export * from './define'
export * from './resolvers'
export * from './optimizeDeps'
export * from './configureServer'
export * from './rollupInputOptions'
export * from './vueCompilerOptions'
import { DepOptimizationOptions } from 'vite'
export const optimizeDeps: DepOptimizationOptions = {
exclude: [
'vue-router',
'@dcloudio/uni-components',
'@dcloudio/uni-h5',
'@dcloudio/uni-h5-vue',
'@dcloudio/uni-shared'
]
}
const VUES = ['vue', 'vue.js', './vue.js']
export const resolvers = [
{
alias(id: string) {
if (VUES.includes(id)) {
return '@dcloudio/uni-h5-vue'
}
}
}
]
import {
buildPluginInject,
buildPluginMainJs,
buildPluginPagesJson,
buildPluginDynamicImport
} from '../build'
import { dynamicImportCode } from '../utils/dynamicImportUtils'
const plugins = [buildPluginMainJs, buildPluginPagesJson, buildPluginInject]
if (dynamicImportCode) {
plugins.push(buildPluginDynamicImport)
}
export const rollupInputOptions = {
plugins
}
import { CompilerOptions } from '@vue/compiler-sfc'
import {
transformEasycom,
transformBuiltInComponent
} from '@dcloudio/uni-cli-shared'
export const vueCompilerOptions: CompilerOptions = {
nodeTransforms: [transformEasycom, transformBuiltInComponent]
}
import * as plugin from './config'
import { Plugin } from 'vite'
import { vueCompilerOptions } from '@dcloudio/uni-cli-shared'
import {
serverPluginEnv,
serverPluginMainJs,
serverPluginPagesJson
} from './server'
import {
buildPluginInject,
buildPluginMainJs,
buildPluginPagesJson,
buildPluginDynamicImport
} from './build'
import { dynamicImportCode } from './utils/dynamicImportUtils'
const VUES = ['vue', 'vue.js', './vue.js']
const plugins = [buildPluginMainJs, buildPluginPagesJson, buildPluginInject]
if (dynamicImportCode) {
plugins.push(buildPluginDynamicImport)
}
const plugin: Plugin = {
define: {
__UNI_WX_API__: true,
__UNI_WXS_API__: true,
__UNI_ROUTER_MODE__: JSON.stringify('hash')
},
resolvers: [
{
alias(id: string) {
if (VUES.includes(id)) {
return '@dcloudio/uni-h5-vue'
}
if (id.startsWith('@/')) {
return id.replace('@/', '/src/')
}
}
}
],
configureServer: [serverPluginEnv, serverPluginMainJs, serverPluginPagesJson],
rollupInputOptions: {
plugins
},
vueCompilerOptions
}
Object.assign(plugin, {
optimizeDeps: {
exclude: [
'vue-router',
'@dcloudio/uni-h5',
'@dcloudio/uni-h5-vue',
'@dcloudio/uni-shared'
]
}
})
export default plugin
export * from './serverPluginEnv'
export * from './serverPluginMainJs'
export * from './serverPluginPagesJson'
import path from 'path'
import { ServerPlugin } from 'vite'
import { initEasycom } from '@dcloudio/uni-cli-shared'
export const serverPluginEnv: ServerPlugin = ({ root }) => {
if (process.env.UNI_INPUT_DIR) {
process.env.UNI_INPUT_DIR = path.resolve(root, 'src')
}
initEasycom({ dirs: ['components'], rootDir: path.resolve(root, 'src') })
}
import path from 'path'
import { ServerPlugin } from 'vite'
import { readBody } from 'vite'
import { ServerPlugin, readBody } from 'vite'
import { getRoot, isMainJs, wrapperMainCode } from '../utils'
export const serverPluginMainJs: ServerPlugin = ({ app, root }) => {
......
import { ServerPlugin } from 'vite'
import { readBody } from 'vite'
import { ServerPlugin, readBody } from 'vite'
import { parsePagesJson } from '../utils'
const uniCode = `import {uni,getCurrentPages,getApp,UniServiceJSBridge,UniViewJSBridge} from '@dcloudio/uni-h5'
......
......@@ -15,8 +15,6 @@ export function getRoot(mainJsPath: string) {
export function wrapperMainCode(code: string, root: string) {
return `${dynamicImportCode}
import '@dcloudio/uni-h5/dist/uni-h5.css'
import '@dcloudio/uni-components/dist/uni-components.css'
import '${slash(path.resolve(root, 'pages.json'))}'
${code}
`
......
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册