1.1.2 • Published 10 months ago

probably-ui v1.1.2

Weekly downloads
-
License
ISC
Repository
-
Last release
10 months ago

使用

import {
    createApp
} from 'vue'
import probablyUi,{
    message,
    DiaLog
} from "probably-ui"
import "probably-ui/style.css";
import App from './App.vue'
const app = createApp(App)
const options = {
	// 是否需要注册工具
	need_utils: true,
	// 全局工具对象命名
	utils_name: '_t',
	//重新定义单独工具的名称
	utils_rename: null,
	// utils_rename: {
	// 	getUrlParam: 'name1'
	// },
	// 是否需要注册组件
	need_component: true,
	//默认弹窗初始的z-index
	z_index: 1,
	// custom_callback: (e) => { }
	need_prototype_change: true,
}
app.use(probablyUi,options).mount('#app')
// 此时全局window会挂载_t属性

代码演示

<template>
  <div class="">
    <!-- TButton === T-button 两种使用方式都可以 -->
    <TButton @click="message({ _title: '服务器歇菜了;', _type: 'fail' })">别点了</TButton>
    <T-button @click="checkType">checkType</T-button>
  </div>
</template>

<script setup>
import { ref } from 'vue'
import { message } from 'probably-ui'
const num = ref('')
const checkType = () => {
  let list = [1, 2]
  // 1、不用特意区分类型大小写
  // 2、类型校验采用的Object.prototype.toString.call,是安全且准确的
  console.log(window._t.checkType(list, 'array'));//true
  console.log(window._t.checkType(list, 'Array'));//true
  console.log(window._t.checkType(list, 'string'));//false
}
</script>

<style scoped>
</style>

除此之外,window._t还提供了下列方法与组件

方法

方法名作用参数
useFetch使用网络请求见具体文件
recode对象解构复制之后,把解构出来的内容克隆到一个新的object或array中
getUrlParam处理url地址

组件

组件名称内容
T-button按钮组件
T-button-group按钮群组件
T-checkbox复选框
T-dialog弹窗组件
T-ellipsis文本组件
T-input输入框
T-switch开关组件
1.1.2

10 months ago

1.1.1

12 months ago

1.1.0

12 months ago

1.0.9

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago