<template> <view class="message"> <u-modal :show="show" :title="title" :content='content' :showCancelButton="true" :title-style="{ color: '#408bf6' }" @confirm="confirm" @cancel="cancel" confirmColor="#408bf6" confirmText="同意" cancelText="拒绝" ></u-modal> </view> </template> <script> export default { name: 'Message', props: { show: { type: Boolean, default: false }, title: { type: String, default: '用户需知' }, content: { type: String, } }, data() { return { } }, methods: { // 同意 confirm() { this.close(); }, // 拒绝 cancel() { this.close(); this.$emit('refuse', false); }, //关闭 close() { this.$emit('close', false); }, } } </script> <style lang="scss" > .message { .u-modal__title { color: red !important; } } </style>