首页 > 解决方案 > 使用 nativescript playground vue 禁用按钮条件

问题描述

当文本字段中没有输入任何内容时,我无法禁用提交按钮。这是我的结帐组件,它是一个子组件。

<template>
<StackLayout>
    <Label class="h1 text-center" text="Cart" style="color:black" />
    <Label class="h2 text-center" text="(select a lesson to remove it)"
        style="color:black" />
    <ListView for="lesson in cart" @itemTap="onItemTap"
        style="color:black" height="auto" minHeight="250">
        <v-template>
            <StackLayout>
                <Label :text="lesson.subject" />
                <Label :text="`price: ${lesson.price}`" />
                <Label :text="`spaces: ${lesson.availableInventory}`" />
            </StackLayout>
        </v-template>
    </ListView>

    <TextField style="color:black;" hint="name" v-model="order.name" />
    <TextField style="color:black;" hint="phone" v-model="order.phone" />


    <Button @tap="submitOrder" text="Submit Order">




</StackLayout>
</template>

标签: nativescript-vue

解决方案


推荐阅读