我正在尝试创建一个代码依赖示例来再现CSS问题。但是,我在创建代码页本身时遇到了一个问题。它没有识别Buefy的b-field
组件--在控制台中出现此警告:
在“密码本设置”中,这些包包括:
https://unpkg.com/buefy/dist/buefy.min.css
这是一个代码库的链接。
下面是代码页中的代码:
JS
const app = Vue.createApp({
data() {
return {
data: { "description": "lantern", "price": "15.75" }
}
}
});
app.mount('#demo');
HTML
<div id="demo">
<!-- using Bulma classes -->
<div class="field is-horizontal">
<div class="field-label is-normal">
<label class="label">Purchase price of {{ data.description }}:</label>
</div>
<div class="field-body">
<div class="field">
{{ data.price }}
</div>
</div>
</div>
<!-- using Buefy component -->
<b-field horizontal label="Purchase Price of Lantern:">{{ data.price }}</b-field>
</div>
CSS
.is-horizontal {
background-color: yellow;
color: red;
}
.field-label {
text-align: left;
background-color: lightblue;
/* specify width */
/*flex-grow: 2;*/ /* overwrites default value of 1 */
min-width: 30%;
/* center text vertically */
display: flex;
align-items: center;
margin-top: -5px;
}
如何解析此警告,以便Buefy组件在代码页示例中工作?
发布于 2022-07-21 03:20:25
您丢失了Buefy的javascript部分。您还需要包括
https://unpkg.com/buefy/dist/buefy.min.js
然而,经过进一步的研究,目前Buefy似乎只支持Vue版本2.x。
发布于 2022-07-21 03:10:24
https://stackoverflow.com/questions/73064925
复制相似问题