我该如何翻译time_ago_in_words?
我缺少 fr 语言环境的翻译文本:
翻译缺失:fr.datetime.distance_in_words.x_days ago|
我在使用stimulus.js定位css属性时遇到问题
我想将显示 Flex 切换为无,并在单击图标时显示 Flex
display:flex
Run Code Online (Sandbox Code Playgroud)
#css
.dropnav{
display:flex
}
Run Code Online (Sandbox Code Playgroud)
#隐藏控制器
......
static targets = [ "hide" ]
static classes =["display"]
connect() {
this.hideTarget.classList.add(this.displayClass)}
toggle(){
this.hideTarget.classList.toggle(this.displayClass)}
.....
Run Code Online (Sandbox Code Playgroud)
#html
....
<li class="nav_items" data-controller="toggle" >
<a href="" data-action="toggle#toggle" ><i class="far fa-user-circle fa-2x "></i></a>
<div class="dropnav" data-toggle-display-class="display" data-toggle-target="hide">
<a href="" class="drop_down_items" ></a>
<a href="" class="drop_down_items">Links</a>
.......
Run Code Online (Sandbox Code Playgroud)
错误信息
Error: Missing attribute "data-toggle-display-class"
Run Code Online (Sandbox Code Playgroud)
我在哪里添加课程?谢谢
我想将我从 Google firestore 获得的时间戳转换为我的 vueApp 中的天数和月数。
我得到一个这样的对象 Object { seconds: 1549843200, nanoseconds: 0 }
<template>
<div v-for="note in notes" :key="note.id" class="note">
<div class="note_dates">
<span class="day">{{note.day}}</span>
<span class="month">{{note.month}}</span>
.........
</template>
<script>
export default {
data() {
return {
notes: []
};
},
methods: {},
created() {
notesCollection.get().then(querySnapshot => {
querySnapshot.forEach(doc => {
const query = {
id: doc.id,
content: doc.data().content,
day: doc.data().created_on,
month: doc.data().created_on
};
this.notes.push(query);
});
});
}
Run Code Online (Sandbox Code Playgroud)
该值created_on是 firestore 集合中的时间戳
因此,在我的视图组件中,我只想回显时间戳中的日期和月份。
当百分比达到 57 时,如何编写三元条件来更改此进度条的颜色
这就是进度条代码的设置方式
<div
class="progress-bar"
role="progressbar"
:style="{width:(quoteCount / maxQuotes) * 100 + '%'}"
aria-valuenow="25"
aria-valuemin="0"
aria-valuemax="100">
{{quoteCount}} / {{maxQuotes}}
</div>
Run Code Online (Sandbox Code Playgroud)
......................
progress-bar bg-danger所以,我想在达到 75% 时添加课程