123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778 |
- <template>
- <view class="u-notice-bar" v-if="show" :style="[{
- backgroundColor: bgColor
- }, $u.addStyle(customStyle)]">
- <template v-if="direction === 'column' || (direction === 'row' && step)">
- <u-column-notice :color="color" :bgColor="bgColor" :text="text" :mode="mode" :step="step" :icon="icon"
- :disable-touch="disableTouch" :fontSize="fontSize" :duration="duration" @close="close"
- @click="click"></u-column-notice>
- </template>
- <template v-else>
- <u-row-notice :color="color" :bgColor="bgColor" :text="text" :mode="mode" :fontSize="fontSize" :speed="speed"
- :url="url" :linkType="linkType" :icon="icon" @close="close" @click="click"></u-row-notice>
- </template>
- </view>
- </template>
- <script>
- import props from './props.js';
- import mpMixin from '../../libs/mixin/mpMixin.js';
- import mixin from '../../libs/mixin/mixin.js';
-
- export default {
- name: "u-notice-bar",
- mixins: [mpMixin, mixin, props],
- data() {
- return {
- show: true
- }
- },
- methods: {
-
- click(index) {
- this.$emit('click', index)
- if (this.url && this.linkType) {
-
- this.openPage()
- }
- },
-
- close() {
- this.show = false
- this.$emit('close')
- }
- }
- };
- </script>
- <style lang="scss" scoped>
- @import "../../libs/css/components.scss";
- .u-notice-bar {
- overflow: hidden;
- padding: 5px 12px;
- flex: 1;
- }
- </style>
|