<view ref="btn" @touchstart="onTouchStart" class="index-add flex-row flex-center">
<g-icon type="plus" size="40" color="#fff" />
</view>
<script setup>
const Binding = uni.requireNativePlugin('bindingx');
const btn = ref()
function onTouchStart (e) {
console.log('???移动么没有效果吗', Binding)
Binding.bind({
anchor: btn.value,
eventType: 'pan',
props: [
{
element: btn.value,
property: 'transform.translateX',
expression: 'x+0'
}
]
}, function (e) {
// nope
console.log(e)
})
}
</script>
<style>
.index-add {
width: 90rpx;
height: 90rpx;
border-radius: 50%;
position: fixed;
bottom: 50rpx;
left: 375rpx;
margin-left: -45rpx;
box-shadow: 0 6rpx 26rpx -12rpx #00c49d;
background-image: linear-gradient(to bottom right, #00c49d, #02ad91);
}
</style>
移动不了
3 个回复
曾小晨 (作者)
顶一下
曾小晨 (作者)
难道没有人用 vue3 玩 bindingx 吗
曾小晨 (作者)
把
btn.value
改成btn.value.ref
就行