feat:还原更新框架
This commit is contained in:
@@ -1,66 +1,63 @@
|
||||
import { defineMixin } from '../../libs/vue'
|
||||
import ReadMoreDefaultProps from './readMore'
|
||||
import { registerComponentProps } from '../../libs/config/props.js'
|
||||
|
||||
const defProps = registerComponentProps(ReadMoreDefaultProps)
|
||||
export const props = defineMixin({
|
||||
props: {
|
||||
// 默认的显示占位高度
|
||||
showHeight: {
|
||||
type: [String, Number],
|
||||
default: () => defProps.readMore.showHeight
|
||||
},
|
||||
// 展开后是否显示"收起"按钮
|
||||
toggle: {
|
||||
type: Boolean,
|
||||
default: () => defProps.readMore.toggle
|
||||
},
|
||||
// 关闭时的提示文字
|
||||
closeText: {
|
||||
type: String,
|
||||
default: () => defProps.readMore.closeText
|
||||
},
|
||||
// 展开时的提示文字
|
||||
openText: {
|
||||
type: String,
|
||||
default: () => defProps.readMore.openText
|
||||
},
|
||||
// 提示的文字颜色
|
||||
color: {
|
||||
type: String,
|
||||
default: () => defProps.readMore.color
|
||||
},
|
||||
// 提示文字的大小
|
||||
fontSize: {
|
||||
type: [String, Number],
|
||||
default: () => defProps.readMore.fontSize
|
||||
},
|
||||
// 是否显示阴影
|
||||
// 此参数不能写在props/readMore.js中进行默认配置,因为使用了条件编译,在外部js中
|
||||
// uni无法准确识别当前是否处于nvue还是非nvue下
|
||||
shadowStyle: {
|
||||
type: Object,
|
||||
default: () => ({
|
||||
// #ifndef APP-NVUE
|
||||
backgroundImage: 'linear-gradient(-180deg, rgba(255, 255, 255, 0) 0%, #fff 80%)',
|
||||
// #endif
|
||||
// #ifdef APP-NVUE
|
||||
// nvue上不支持设置复杂的backgroundImage属性
|
||||
backgroundImage: 'linear-gradient(to top, #fff, rgba(255, 255, 255, 0.5))',
|
||||
// #endif
|
||||
paddingTop: '100px',
|
||||
marginTop: '-100px'
|
||||
})
|
||||
},
|
||||
// 段落首行缩进的字符个数
|
||||
textIndent: {
|
||||
type: String,
|
||||
default: () => defProps.readMore.textIndent
|
||||
},
|
||||
// open和close事件时,将此参数返回在回调参数中
|
||||
name: {
|
||||
type: [String, Number],
|
||||
default: () => defProps.readMore.name
|
||||
}
|
||||
}
|
||||
})
|
||||
import { defineMixin } from '../../libs/vue'
|
||||
import defProps from '../../libs/config/props.js'
|
||||
export const props = defineMixin({
|
||||
props: {
|
||||
// 默认的显示占位高度
|
||||
showHeight: {
|
||||
type: [String, Number],
|
||||
default: () => defProps.readMore.showHeight
|
||||
},
|
||||
// 展开后是否显示"收起"按钮
|
||||
toggle: {
|
||||
type: Boolean,
|
||||
default: () => defProps.readMore.toggle
|
||||
},
|
||||
// 关闭时的提示文字
|
||||
closeText: {
|
||||
type: String,
|
||||
default: () => defProps.readMore.closeText
|
||||
},
|
||||
// 展开时的提示文字
|
||||
openText: {
|
||||
type: String,
|
||||
default: () => defProps.readMore.openText
|
||||
},
|
||||
// 提示的文字颜色
|
||||
color: {
|
||||
type: String,
|
||||
default: () => defProps.readMore.color
|
||||
},
|
||||
// 提示文字的大小
|
||||
fontSize: {
|
||||
type: [String, Number],
|
||||
default: () => defProps.readMore.fontSize
|
||||
},
|
||||
// 是否显示阴影
|
||||
// 此参数不能写在props/readMore.js中进行默认配置,因为使用了条件编译,在外部js中
|
||||
// uni无法准确识别当前是否处于nvue还是非nvue下
|
||||
shadowStyle: {
|
||||
type: Object,
|
||||
default: () => ({
|
||||
// #ifndef APP-NVUE
|
||||
backgroundImage: 'linear-gradient(-180deg, rgba(255, 255, 255, 0) 0%, #fff 80%)',
|
||||
// #endif
|
||||
// #ifdef APP-NVUE
|
||||
// nvue上不支持设置复杂的backgroundImage属性
|
||||
backgroundImage: 'linear-gradient(to top, #fff, rgba(255, 255, 255, 0.5))',
|
||||
// #endif
|
||||
paddingTop: '100px',
|
||||
marginTop: '-100px'
|
||||
})
|
||||
},
|
||||
// 段落首行缩进的字符个数
|
||||
textIndent: {
|
||||
type: String,
|
||||
default: () => defProps.readMore.textIndent
|
||||
},
|
||||
// open和close事件时,将此参数返回在回调参数中
|
||||
name: {
|
||||
type: [String, Number],
|
||||
default: () => defProps.readMore.name
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
@@ -1,23 +1,22 @@
|
||||
/*
|
||||
* @Author : LQ
|
||||
* @Description :
|
||||
* @version : 3.0
|
||||
* @Date : 2021-08-20 16:44:21
|
||||
* @LastAuthor : jry
|
||||
* @lastTime : 2025-12-19 08:55:21
|
||||
* @FilePath : /uview-plus/libs/config/props/readMore.js
|
||||
*/
|
||||
import { t } from '../../libs/i18n'
|
||||
export default {
|
||||
// readMore
|
||||
readMore: {
|
||||
showHeight: 400,
|
||||
toggle: false,
|
||||
closeText: t("up.readMore.expand"),
|
||||
openText: t("up.readMore.fold"),
|
||||
color: '#2979ff',
|
||||
fontSize: 14,
|
||||
textIndent: '2em',
|
||||
name: ''
|
||||
}
|
||||
}
|
||||
/*
|
||||
* @Author : LQ
|
||||
* @Description :
|
||||
* @version : 1.0
|
||||
* @Date : 2021-08-20 16:44:21
|
||||
* @LastAuthor : LQ
|
||||
* @lastTime : 2021-08-20 17:18:41
|
||||
* @FilePath : /u-view2.0/uview-ui/libs/config/props/readMore.js
|
||||
*/
|
||||
export default {
|
||||
// readMore
|
||||
readMore: {
|
||||
showHeight: 400,
|
||||
toggle: false,
|
||||
closeText: '展开阅读全文',
|
||||
openText: '收起',
|
||||
color: '#2979ff',
|
||||
fontSize: 14,
|
||||
textIndent: '2em',
|
||||
name: ''
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,11 +33,11 @@
|
||||
margin="0 5px 0 0"
|
||||
></up-text>
|
||||
<view class="u-read-more__toggle__icon">
|
||||
<up-icon
|
||||
<u-icon
|
||||
:color="color"
|
||||
:size="fontSize + 2"
|
||||
:name="status === 'close' ? 'arrow-down' : 'arrow-up'"
|
||||
></up-icon>
|
||||
></u-icon>
|
||||
</view>
|
||||
</view>
|
||||
</slot>
|
||||
@@ -56,7 +56,7 @@
|
||||
/**
|
||||
* readMore 阅读更多
|
||||
* @description 该组件一般用于内容较长,预先收起一部分,点击展开全部内容的场景。
|
||||
* @tutorial https://uview-plus.jiangruyi.com/components/readMore.html
|
||||
* @tutorial https://ijry.github.io/uview-plus/components/readMore.html
|
||||
* @property {String | Number} showHeight 内容超出此高度才会显示展开全文按钮,单位px(默认 400 )
|
||||
* @property {Boolean} toggle 展开后是否显示收起按钮(默认 false )
|
||||
* @property {String} closeText 关闭时的提示文字(默认 '展开阅读全文' )
|
||||
@@ -140,6 +140,8 @@
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@import "../../libs/css/components.scss";
|
||||
|
||||
.u-read-more {
|
||||
|
||||
&__content {
|
||||
|
||||
Reference in New Issue
Block a user