我试图仅使用 CSS 制作一些方形背景,但我只有线条背景,而没有水平线条选项。
这是我的示例代码:
.container{
background-color:red;
width: 400px; height:200px; margin:0 auto;
background-image: linear-gradient(90deg, rgba(255, 255, 255, .5) 95px , transparent 50%),
linear-gradient(rgba(255, 255, 255, 0) 5px, transparent 100%);
background-size: 100px 100%;
}Run Code Online (Sandbox Code Playgroud)
<div class="container">
</div>Run Code Online (Sandbox Code Playgroud)
html css background-image linear-gradients repeating-linear-gradient
我有一个包含大量数据列表和一些用于过滤的按钮的页面。
例如按状态过滤的 2 个按钮:
完成状态
取消状态
我希望当用户单击完整的 url 时将其更改为
http://demo.com/list?filter=complete
页面不会重新加载,它只是为了获取特定的 url foreach 过滤器按钮。
如何在 Nuxt 应用程序中实现代码?
这是我的代码
detailsGroup = new FormGroup({
userId:new FormControl('1'),
firstName: new FormControl('', Validators.required),
lastName: new FormControl('', Validators.required),
email: new FormControl('',[ Validators.required, Validators.email]),
});
Run Code Online (Sandbox Code Playgroud)
我希望如果userId equal to 1名字、姓氏和电子邮件不需要,
otherwise这 3 个字段将更改为必填,并且电子邮件还验证电子邮件地址。
谢谢
我使用带有导出按钮的角度数据表插件。
这里的例子:http ://l-lin.github.io/angular-datatables/#/withButtons
vm.dtOptions = DTOptionsBuilder.fromSource('data.json')
.withDOM('frtip')
.withPaginationType('full_numbers')
// Active Buttons extension
.withButtons([
'columnsToggle',
'colvis',
'copy',
'print',
'excel',
{
text: 'Some button',
key: '1',
action: function (e, dt, node, config) {
alert('Button activated');
}
}
]);
Run Code Online (Sandbox Code Playgroud)
我的问题是,当我尝试导出时,显示隐藏的列。
我尝试找到仅导出可见列的解决方案,我在这里找到解决方案 https://datatables.net/forums/discussion/3210/tabletools-how-to-hide-columns-when-exporting-copying
$('#list').dataTable({
"sDom": 'T<"clear">lfrtip',
"oTableTools": {
"sSwfPath": "swf/copy_cvs_xls_pdf.swf", // setting path for swf file. Displays export buttons
"aButtons": [{
"sExtends": "copy",
"mColumns": [0, 1, 2, 3, 4, 5] // Export settings for Copy to Clipboard
}, {
"sExtends": "csv",
"mColumns": [0, …Run Code Online (Sandbox Code Playgroud) 我不知道我错过了什么,但当我调试时,突变或查询的输入始终为空,似乎输入是空对象
这是我的代码:
解析器
@Query(() => String)
async testMutation(@Args('args') args: UpvotePostInput) {
return args.postId;
}
Run Code Online (Sandbox Code Playgroud)
数据传输工具
import { InputType, Field } from '@nestjs/graphql';
@InputType()
export class UpvotePostInput {
@Field(() => String)
postId: string;
}
Run Code Online (Sandbox Code Playgroud)
错误
{
"errors": [
{
"message": "Cannot return null for non-nullable field Query.testMutation.",
"locations": [
{
"line": 2,
"column": 3
}
],
"path": [
"testMutation"
],
"extensions": {
"code": "INTERNAL_SERVER_ERROR",
"exception": {
"stacktrace": [
"Error: Cannot return null for non-nullable field Query.testMutation.",
" at completeValue (/....js:559:13)", …Run Code Online (Sandbox Code Playgroud) {error:true}我从服务器获得了一个 JSON 对象 ( )。
我尝试检查对象是否包含键“error”,并且键存在,函数 hasOwnProperty 返回false。
这是我的代码:
$http({
headers: { 'Content-Type': 'application/x-www-form-urlencoded;charset=utf-8;' },
url: '/Modules/Partners/Mailing/SendMail.ashx',
data: $.param({ contact: JSON.stringify(contact), body: partnerObject.mailTemplate.longValue, title: "" }),
method: 'POST'
})
.success(function (data, status, headers, config) {
console.log(data);
console.log(data.hasOwnProperty('error'));
if (data.hasOwnProperty('error')) {
deferred.reject(contact);
} else {
deferred.resolve(contact);
}
//console.log(data)
})
.error(function (data, status, headers, config) {
deferred.reject(contact);
});
Run Code Online (Sandbox Code Playgroud)
在控制台中,我可以看到该对象包含返回的“error”hasOwnProperty('error')键false
我想运行此查询
INSERT INTO [tblPollLogs]
([lastModified]
,[ip]
,[a1]
,[a2]
)
VALUES
(getdate()
,'aaa'
,(select top 1 header from [tblPollAnswer] where [pollAnswerId] = @param1)
,(select top 1 header from [tblPollAnswer] where [pollAnswerId] = @param2)
)
Run Code Online (Sandbox Code Playgroud)
但是我得到了错误
在此上下文中不允许子查询.只允许标量表达式.
我可以在一个查询中运行此查询,或者我需要在运行此查询之前获取值
谢谢
我有一个类在 Java 中扩展了另一个类
我需要构造函数来运行超级构造函数
这是我的基本代码:
public class Polygon implements Geometry {
public Polygon(Point3D... vertices) {
......
}
}
Run Code Online (Sandbox Code Playgroud)
我想从子类调用它
public class Triangle extends Polygon {
//ctor
public Triangle(Point3D point3d, Point3D point3d2, Point3D point3d3){
List<Point3D> _temp = null;
_temp.add(point3d);
_temp.add(point3d2);
_temp.add(point3d3);
super(_temp);
}
}
Run Code Online (Sandbox Code Playgroud)
我该怎么做,因为我收到错误“构造函数调用必须是构造函数中的第一条语句”,但我需要构建构造函数
谢谢