我正在使用Bootstrap V4为我的新网站看到它在Alpha中.
但是我看不到它的构建中有datepicker.js.
有谁知道这是否会包含在V4中?如果没有,任何人都可以推荐一个好日期选择器?
谢谢
我正在使用Vuetify
withNuxt.js
并且我已经分块了我的 css 文件,这样当我使用 npm run generate 时,我的所有样式都不会包含在我网站的每个页面中。为了做到这一点,我补充说......
build: {
extractCSS: true,
splitChunks: {
layouts: true
}
}
Run Code Online (Sandbox Code Playgroud)
但是我的vuetify-theme-stylesheet
主题文件仍然包含在每个页面中。我怎样才能让我的vuetify-theme-stylesheet
文件像我的 CSS 的其余部分一样分块?
<style data-n-head="vuetify" type="text/css" id="vuetify-theme-stylesheet" nonce="undefined">.v-application a{color:#0769ba}.v-application .primary{background-color:#0769ba!important;border-color:#0769ba!important}.v-application .primary--text{color:#0769ba!important;caret-color:#0769ba!important}
Run Code Online (Sandbox Code Playgroud) 我正在使用 Google 自动完成并收到此错误
InvalidValueError: not an instance of HTMLInputElement
Run Code Online (Sandbox Code Playgroud)
我认为谷歌有 getElementById 用于降价
var input = /** @type {!HTMLInputElement} */(
document.getElementById('pac-input'));
Run Code Online (Sandbox Code Playgroud)
但是我不确定它的用法。我的代码如下
var options ={
types:['(cities)'],
};
var input = document.getElementById('destination');
var autocomplete = new google.maps.places.Autocomplete(input, options);
}
google.maps.event.addDomListener(window, 'load', initialize);
Run Code Online (Sandbox Code Playgroud) 我正在使用jQuery filtername
在onClick上设置数据属性,工作正常.
$('#tag-group ul').append('<li><i class="fa fa-times" aria-hidden="true" data-filtergroup="'+filterGroup+'" data-filtername="'+filterName+'"></i>'+text+'</li>');
Run Code Online (Sandbox Code Playgroud)
它在屏幕上显示为ok
<li><i class="fa fa-times" aria-hidden="true" data-filtergroup="location" data-filtername="Melbourne"></i> Melbourne</li>
Run Code Online (Sandbox Code Playgroud)
然后我试图在另一个onClick上再次拿起它,但它回来时未定义.当console log $(this).text();
它工作但我控制日志时$(this).data('filtername');
它是未定义的.如果它是由jQuery生成的,dom是否隐藏它?
$(document).on('click','#sau-filter-tags ul li', function(event){
var text = $(this).text();
var filterName = $(this).data('filtername');
console.log(filterName); //Undefined
});
Run Code Online (Sandbox Code Playgroud) 我的index.html
模板中有一个搜索栏,我需要隐藏在某些页面上.我正在使用ui-router
和$state
.
我可以使这项工作的唯一方法就是注入$rootscope
到我的所有控制器要么ng-hide: true
或false
将其打开或关闭需要的地方.(我只需要隐藏在1或2页上)
我不认为这是正确的方法,因为我的所有控制器现在都依赖并注入了$rootscope
.
还有另一种方法吗?
我正在尝试根据其文档在vueJs 2.0中使用车把使用VueJs条件渲染,但eslint回来了并且出现错误:
- avoid using JavaScript keyword as property name: "if" in expression {{#if ok}}
- avoid using JavaScript keyword as property name: "if" in expression {{/if}}
Run Code Online (Sandbox Code Playgroud)
VueJs似乎没有渲染它。
<!-- Handlebars template -->
{{#if ok}}
<h1>Yes</h1>
{{/if}}
Run Code Online (Sandbox Code Playgroud) 我正在使用vueJs,并且有一个单选按钮组。检查收音机后,如何将CSS边框属性绑定到类:class="selected"
?
该:checked
属性不起作用,因为我已将其绑定到v模型。
因此,如果选中了广播,则将一个类(选定)绑定到div。
<div class="sau-select lg center" :class="selected">
<label for="windows">
<input type="radio" id="windows" value="windows" v-model="selectedOs" :checked="checked">
<span></span>
<img src="/img/windows.gif" alt="Windows">Windows
</label>
</div>
Run Code Online (Sandbox Code Playgroud) 我需要拆分数组中的一些对象.例如
[{"age":"3"},{"age":"5"},{"age":"4"},{"age":"5"}]
Run Code Online (Sandbox Code Playgroud)
我需要它在对象内部采取许多,因此它显示.
[3,5,4,5]
Run Code Online (Sandbox Code Playgroud) 我正在使用 nuxt.js 并需要使用 ld+json 为 google 使用结构化数据
我将使用已填充并通过 JSON.stringify 方法运行的动态数据。
我是否正确地将其用于 XXS 脚本?另外,我是否需要传递 __dangerouslyDisableSanitizers,因为我不确定已提供的文档?
head(){
let user = this.user;
return {
title: 'This is my page title',
meta: [
{ hid: 'description', name: 'description', content: 'This is my description' }
],
script: [
{
innerHTML: JSON.stringify({
'@context': 'http://schema.org',
'@type': 'Website',
'url': `${user}`
}),
type: 'application/ld+json'
}
],
__dangerouslyDisableSanitizers: ['script']
}
},
Run Code Online (Sandbox Code Playgroud) 我有一系列v-model
与值绑定的复选框。
但是,当您进入该页面时,我需要预先选中一些复选框。我无法使用:checked
绑定,因为我正在使用v-model
并且我需要 v-model 将值传递给我的checkedNames
数组。
<div id='example-3'>
<input type="checkbox" id="jack" value="Jack" v-model="checkedNames" PRE-CHECK-THIS-CHECKBOX>
<label for="jack">Jack</label>
<input type="checkbox" id="john" value="John" v-model="checkedNames">
<label for="john">John</label>
<input type="checkbox" id="mike" value="Mike" v-model="checkedNames">
<label for="mike">Mike</label>
<br>
<span>Checked names: {{ checkedNames }}</span>
</div>
Run Code Online (Sandbox Code Playgroud)
new Vue({
el: '#example-3',
data: {
checkedNames: []
}
})
Run Code Online (Sandbox Code Playgroud) vue.js ×5
javascript ×4
nuxt.js ×2
angularjs ×1
bootstrap-4 ×1
eslint ×1
google-api ×1
jquery ×1
vuejs2 ×1
vuetify.js ×1