123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101 |
- <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';
-
- export default {
- name: "u-notice-bar",
- mixins: [uni.$u.mpMixin, uni.$u.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: 9px 12px;
- flex: 1;
- }
- </style>
|