uniapp 微信小程序客服按钮组件

uniapp yekong 1360℃

uniapp 微信小程序开发时经常是需要用到客服按钮,但是客服按钮的样式需要自定义,每次都需要手动调整样式,为了节省时间,干脆封装成组件,直接专注自己代码样式就可以了。

<template>
	<button open-type="contact" session-from="">
		<slot></slot>
	</button>
</template>

<script>
</script>

<style lang="scss" scoped>
	button {
		border: none;
		background: none;
		padding: 0;
		border: 0;
		margin: 0;
		line-height: 0;
	}

	button::after {
		border: none;
	}
</style>


使用

import customerService from '../../components/customerService.vue'
		components: {
			customerService
		},
<customerService><text class="text_13">更改</text></customerService>
喜欢 (1)