tiny-vue
tiny-vue copied to clipboard
🐛 [Bug]: 一套代码同时支持 PC 端和移动端如何体现?
Version
lastest
Vue Version
lastest
Link to minimal reproduction
切换到移动端没看到移动端应有的操作方式,比如:下拉选择,日期选择等,没找到反馈渠道不好意思,发个BUG。
Step to reproduce
切换到移动端没看到移动端应有的操作方式,比如:下拉选择,日期选择等,没找到反馈渠道不好意思,发个BUG。
What is expected
下拉有移动端弹出选择的效果,日期选择也是一样。
What is actually happening
和PC端一样展示了
Any additional comments (optional)
No response
Bot detected the issue body's language is not English, translate it automatically.
Title: 🐛 [Bug]: How about one set of code supporting both PC and mobile terminals?
抱歉给你带来困扰。 组件默认是pc模式,添加属性: tiny_mode='mobile' 可以指定它为mobile样式! 你可以使用以下代码验证:
<template>
<tiny-layout>
<tiny-row>
<div> pc mode </div>
<tiny-button>默认按钮</tiny-button>
<tiny-button type="primary" native-type="submit"> 主要按钮 </tiny-button>
<tiny-button type="success"> 成功按钮 </tiny-button>
<tiny-button type="info"> 信息按钮 </tiny-button>
<tiny-button type="warning"> 警告按钮 </tiny-button>
<tiny-button type="danger"> 危险按钮 </tiny-button>
<tiny-alert description="type 为默认值 info"></tiny-alert>
</tiny-row>
<tiny-row>
<div> mobile mode </div>
<tiny-button tiny_mode='mobile'>默认按钮</tiny-button>
<tiny-button tiny_mode='mobile' type="primary" native-type="submit"> 主要按钮 </tiny-button>
<tiny-button tiny_mode='mobile' type="success"> 成功按钮 </tiny-button>
<tiny-button tiny_mode='mobile' type="info"> 信息按钮 </tiny-button>
<tiny-button tiny_mode='mobile' type="warning"> 警告按钮 </tiny-button>
<tiny-button tiny_mode='mobile' type="danger"> 危险按钮 </tiny-button>
<tiny-alert tiny_mode='mobile' description="type 为默认值 info"></tiny-alert>
</tiny-row>
</tiny-layout>
</template>
<script setup>
import { Button as TinyButton, Layout as TinyLayout, Row as TinyRow,Alert as TinyAlert } from '@opentiny/vue'
</script>
<style scoped>
.tiny-row {
margin-bottom: 20px;
}
.tiny-button {
margin-bottom: 10px;
margin-left: 0;
margin-right: 8px;
}
</style>
mobile的源码都开源在github仓库,但移动端的文档暂时内源,这造成了你的困惑。 移动端的开源也在计划之中的,请多多关注我们的官网~~~
Bot detected the issue body's language is not English, translate it automatically.
The source code of mobile is all open source in the github repository, but the mobile documentation is temporarily in-source, which causes your confusion. Open source for mobile terminals is also planned, please pay more attention to our official website~~~
mobile的源码都开源在github仓库,但移动端的文档暂时内源,这造成了你的困惑。 移动端的开源也在计划之中的,请多多关注我们的官网~~~
内源=>闭源😊
Bot detected the issue body's language is not English, translate it automatically.
The source code of mobile is all open source in the github repository, but the mobile documentation is temporarily in-source, which causes your confusion. Open source for mobile terminals is also planned, please pay more attention to our official website~~~
Internal source => closed source😊
@wall-git 还可以通过设置全局变量的方式使用mobile组件。
如果你是 Vue3 项目:
import { getCurrentInstance } from 'vue'
const app = getCurrentInstance()
app.config.globalProperties.tiny_mode = 'mobile'
如果你是 Vue2 项目:
Vue.prototype.tiny_mode="mobile"
借机在这里咨询下,后续是否有继续扩大移动端组件的计划?比如 toast 轻提示,PullRefresh 下拉刷新,swipe左右滑动 之类的移动端特有交互组件。
Bot detected the issue body's language is not English, translate it automatically.
Are there any plans to expand mobile components in the future? For example, toast light prompts, PullRefresh pull-down refresh, swipe left and right sliding and other mobile-specific interactive components.