無法將屬性disable設定為按鈕
P粉039633152
P粉039633152 2023-08-16 20:54:18
0
1
341
<p>如下所示的程式碼中,我正在開發一個子元件,在其中我建立了一個按鈕,並且想要新增 <code>disable</code> 屬性。 給定下面的程式碼,<code>disable</code> 屬性被紅色底線標記,並且錯誤訊息顯示:</p> <pre class="brush:php;toolbar:false;">類型 '"isDigitizePolygonDisabled"' 無法賦值給型別 'Booleanish | undefined'</pre> <p>請告訴我如何正確設定 <code>disable</code> 屬性 <strong>代碼</strong>:</p> <pre class="brush:php;toolbar:false;"><template> <button id="idDigitizePolygonBtn" class="digitizePolygonBtn" disabled='isDigitizePolygonDisabled'> <slot></slot> </button> </template> <script lang="ts"> import { ref } 從 'vue' let isDigitizePolygonDisabled = ref(true) export default { data() { return { isDigitizePolygonDisabled } }, props: { isDigitizePolygonDisabled: { type: Boolean, required: true }, } </script></pre> <p><br /></p>
P粉039633152
P粉039633152

熱門教學
更多>
最新下載
更多>
網站特效
網站源碼
網站素材
前端模板
關於我們 免責聲明 Sitemap
PHP中文網:公益線上PHP培訓,幫助PHP學習者快速成長!