chore: initialize qiming workspace repository
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
/* #ifdef MP */
|
||||
:host {
|
||||
flex-shrink: 0;
|
||||
box-sizing: border-box;
|
||||
width: 100%;
|
||||
}
|
||||
/* #endif */
|
||||
|
||||
.l-tab__panel {
|
||||
width: 100%;
|
||||
/* #ifdef UNI-APP-X */
|
||||
flex: 1;
|
||||
/* #endif */
|
||||
flex-shrink: 0;
|
||||
box-sizing: border-box;
|
||||
/* #ifndef APP-ANDROID || APP-IOS || APP-HARMONY */
|
||||
overflow-y: auto;
|
||||
-webkit-overflow-scrolling: touch;
|
||||
/* #endif */
|
||||
// &--active {
|
||||
// height: auto;
|
||||
// }
|
||||
|
||||
// &--inactive {
|
||||
// height: 0;
|
||||
// overflow: visible;
|
||||
// }
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
<template>
|
||||
<view class="l-tab__panel" aria-role="tabpanel">
|
||||
<slot/>
|
||||
</view>
|
||||
</template>
|
||||
<script lang="uts" setup>
|
||||
/**
|
||||
* TabPanel 标签页面板组件
|
||||
* @description 用于构建Tabs组件的单个内容面板,必须作为Tabs的子组件使用
|
||||
* <br>插件类型:LTabPanelComponentPublicInstance
|
||||
* @tutorial https://ext.dcloud.net.cn/plugin?name=lime-tabs
|
||||
*
|
||||
* @property {any} badge 徽标配置
|
||||
* @property {number[]} offset 徽标位置偏移量[x,y]
|
||||
* @property {boolean} dot 是否显示圆点徽标(默认:false)
|
||||
* @property {boolean} destroyOnHide 内容隐藏时销毁DOM(默认:false)
|
||||
* @property {boolean} disabled 禁用当前选项卡(默认:false)
|
||||
* @property {string} label 选项卡标题内容
|
||||
* @property {boolean} lazy 启用懒加载(默认:false)
|
||||
* @property {number} value 选项卡唯一标识
|
||||
*/
|
||||
|
||||
import { TabPanelProps } from './type';
|
||||
import { TabPanel } from '../l-tabs/type'
|
||||
const props = withDefaults(defineProps<TabPanelProps>(), {})
|
||||
const children = inject<LTabPanelComponentPublicInstance[]|null>('LimeTabs', null) as Ref<LTabPanelComponentPublicInstance[]>|null;
|
||||
const instance = getCurrentInstance()!.proxy!
|
||||
onMounted(()=>{
|
||||
if(children == null) return
|
||||
children.value.push(instance as LTabPanelComponentPublicInstance)
|
||||
})
|
||||
|
||||
|
||||
// #ifdef APP-ANDROID
|
||||
// 安卓端数组属性存在BUG 死循环
|
||||
const innderOffset = ref<any[]>([])
|
||||
watch((): any[]|null => props.offset, (n: any[]|null) => {
|
||||
if(innderOffset.value.join('') == n?.join('')) return
|
||||
innderOffset.value = n ?? []
|
||||
}, {immediate: true})
|
||||
|
||||
defineExpose({
|
||||
innderOffset
|
||||
})
|
||||
// #endif
|
||||
|
||||
|
||||
onUnmounted(()=>{
|
||||
if(children == null) return
|
||||
children.value = children.value.filter((it):boolean => it != (instance))
|
||||
})
|
||||
</script>
|
||||
<style lang="scss">
|
||||
@import './index';
|
||||
</style>
|
||||
@@ -0,0 +1,48 @@
|
||||
<template>
|
||||
<view class="l-tab__panel" aria-role="tabpanel">
|
||||
<slot/>
|
||||
</view>
|
||||
</template>
|
||||
<script lang="ts">
|
||||
// @ts-nocheck
|
||||
/**
|
||||
* TabPanel 标签页面板组件
|
||||
* @description 用于构建Tabs组件的单个内容面板,必须作为Tabs的子组件使用
|
||||
* <br>插件类型:LTabPanelComponentPublicInstance
|
||||
* @tutorial https://ext.dcloud.net.cn/plugin?name=lime-tabs
|
||||
*
|
||||
* @property {any} badge 徽标配置
|
||||
* @property {number[]} offset 徽标位置偏移量[x,y]
|
||||
* @property {boolean} dot 是否显示圆点徽标(默认:false)
|
||||
* @property {boolean} destroyOnHide 内容隐藏时销毁DOM(默认:false)
|
||||
* @property {boolean} disabled 禁用当前选项卡(默认:false)
|
||||
* @property {string} label 选项卡标题内容
|
||||
* @property {boolean} lazy 启用懒加载(默认:false)
|
||||
* @property {number} value 选项卡唯一标识
|
||||
*/
|
||||
import {onMounted, defineComponent, inject, onUnmounted} from '@/uni_modules/lime-shared/vue';
|
||||
import panelProps from './props';
|
||||
export default defineComponent({
|
||||
name: 'l-tab-panel',
|
||||
props: panelProps,
|
||||
setup(props) {
|
||||
const children = inject<LTabPanelComponentPublicInstance[]|null>('LimeTabs', null) as Ref<LTabPanelComponentPublicInstance[]>|null;
|
||||
onMounted(()=>{
|
||||
if(!children) return
|
||||
children.value.push(props)
|
||||
})
|
||||
|
||||
onUnmounted(()=>{
|
||||
if(!children) return
|
||||
children.value = children.value.filter((it):boolean => it != props)
|
||||
})
|
||||
|
||||
return {
|
||||
|
||||
}
|
||||
}
|
||||
})
|
||||
</script>
|
||||
<style lang="scss">
|
||||
@import './index';
|
||||
</style>
|
||||
@@ -0,0 +1,48 @@
|
||||
export default {
|
||||
/**
|
||||
* 透传至 Badge 组件
|
||||
*/
|
||||
badge: {
|
||||
type: [String, Number]
|
||||
},
|
||||
offset: {
|
||||
type: Array
|
||||
},
|
||||
dot: {
|
||||
type: Boolean,
|
||||
defalut: false
|
||||
},
|
||||
/**
|
||||
* 选项卡内容隐藏时是否销毁
|
||||
*/
|
||||
destroyOnHide: {
|
||||
type: Boolean,
|
||||
defalut: false
|
||||
},
|
||||
/**
|
||||
* 是否禁用当前选项卡
|
||||
*/
|
||||
disabled: {
|
||||
type: Boolean,
|
||||
defalut: false
|
||||
},
|
||||
/**
|
||||
* 选项卡名称,可自定义选项卡导航内容
|
||||
*/
|
||||
label: {
|
||||
type: String
|
||||
},
|
||||
/**
|
||||
* 是否启用选项卡懒加载
|
||||
*/
|
||||
lazy: {
|
||||
type: Boolean,
|
||||
defalut: false
|
||||
},
|
||||
/**
|
||||
* 选项卡的值,唯一标识
|
||||
*/
|
||||
value: {
|
||||
type: [Number, String]
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
// @ts-nocheck
|
||||
export interface TabPanelProps {
|
||||
/**
|
||||
* 透传至 Badge 组件
|
||||
*/
|
||||
badge?: any;
|
||||
offset?: any[];
|
||||
dot?: boolean;
|
||||
/**
|
||||
* 选项卡内容隐藏时是否销毁
|
||||
*/
|
||||
destroyOnHide?: boolean;
|
||||
/**
|
||||
* 是否禁用当前选项卡
|
||||
*/
|
||||
disabled?: boolean;
|
||||
/**
|
||||
* 选项卡名称,可自定义选项卡导航内容
|
||||
*/
|
||||
label?: string;
|
||||
/**
|
||||
* 是否启用选项卡懒加载
|
||||
*/
|
||||
lazy?: boolean;
|
||||
/**
|
||||
* 选项卡的值,唯一标识
|
||||
*/
|
||||
value?: number;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user