|
@@ -2,7 +2,12 @@
|
|
|
<button :class="classes" :style="getStyle" @click="handleClick">
|
|
<button :class="classes" :style="getStyle" @click="handleClick">
|
|
|
<view class="nut-button__warp">
|
|
<view class="nut-button__warp">
|
|
|
<nut-icon class="nut-icon-loading" v-if="loading"></nut-icon>
|
|
<nut-icon class="nut-icon-loading" v-if="loading"></nut-icon>
|
|
|
- <nut-icon :class="icon" v-if="icon && !loading" :name="icon"></nut-icon>
|
|
|
|
|
|
|
+ <nut-icon
|
|
|
|
|
+ v-if="icon && !loading"
|
|
|
|
|
+ :name="icon"
|
|
|
|
|
+ :class-prefix="iconClassPrefix"
|
|
|
|
|
+ :font-class-name="iconFontClassName"
|
|
|
|
|
+ ></nut-icon>
|
|
|
<view :class="{ text: icon || loading }" v-if="$slots.default">
|
|
<view :class="{ text: icon || loading }" v-if="$slots.default">
|
|
|
<slot></slot>
|
|
<slot></slot>
|
|
|
</view>
|
|
</view>
|
|
@@ -55,6 +60,14 @@ export default create({
|
|
|
icon: {
|
|
icon: {
|
|
|
type: String,
|
|
type: String,
|
|
|
default: ''
|
|
default: ''
|
|
|
|
|
+ },
|
|
|
|
|
+ iconClassPrefix: {
|
|
|
|
|
+ type: String,
|
|
|
|
|
+ default: 'nut-icon'
|
|
|
|
|
+ },
|
|
|
|
|
+ iconFontClassName: {
|
|
|
|
|
+ type: String,
|
|
|
|
|
+ default: 'nutui-iconfont'
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
emits: ['click'],
|
|
emits: ['click'],
|