我正在尝试从渲染函数渲染单个文件 Vue 组件,但它没有被创建。我尝试了类似的变体:
// simple.vue
<template>
...
</template>
<script>
...
</script>
// parent.vue
<script>
import Simple from
export default {
name: "parentComponent",
render: function (h) {
return h(
"div",
null,
Simple // [Simple], Vue.component(Simple)
}
}
</script>
Run Code Online (Sandbox Code Playgroud)
如何从渲染函数构建 Vue 组件?如果它有所作为,我也在使用哈巴狗。
在我的macOS(不使用Minikube)上,我在这个例子之后模拟了我的Kubernetes集群,这意味着我已经按顺序执行了这个:
# Adding my own service to redix-proxy
kubectl create -f ./redis/redis-service.yaml
# Create a bootstrap master
kubectl create -f examples/storage/redis/redis-master.yaml
# Create a service to track the sentinels
kubectl create -f examples/storage/redis/redis-sentinel-service.yaml
# Create a replication controller for redis servers
kubectl create -f examples/storage/redis/redis-controller.yaml
# Create a replication controller for redis sentinels
kubectl create -f examples/storage/redis/redis-sentinel-controller.yaml
# Scale both replication controllers
kubectl scale rc redis --replicas=3
kubectl scale rc redis-sentinel --replicas=3
# Adding my own NodeJS web …
Run Code Online (Sandbox Code Playgroud) 假设我的文档中有一个如下所示的 DOM:
<body>
<div id="outer">
<custom-web-component>
#shadow-root (open)
<div id="inner">Select Me</div>
</custom-web-component>
</div>
</body>
Run Code Online (Sandbox Code Playgroud)
是否可以使用单个querySelector
参数来选择影子根内的内部 div document
?如果是的话,它是如何构建的?
例如,类似的东西document.querySelector('custom-web-component > #inner')
如何从 中找到的元素中检索按钮文本vue-test-utils
?我正在使用 v1.0.0-beta.10
例如,在我的 vue 文件中,我有一个按钮,如:
el-button(@click.native="cancel",
size="small",
native-type="button") Cancel
Run Code Online (Sandbox Code Playgroud)
然后在我的测试中:
const button = wrapper.findAll({
name: "el-button"
})
console.log('buttonAll is', button.at(2).vnode.$attrs) // {}
Run Code Online (Sandbox Code Playgroud)
我得到一个空对象。更好的是,如何根据按钮文本直接查询该 Vue 组件?
我试图在两列(name
和a
)之间设置唯一约束,一列为 type text
,另一列为 type json
。我如何在 Postgres 9.6.3 中构建它?
示例行如下所示:
{ name: 'someName',
a: {
b: {
c: 'some text'
}
}
}
Run Code Online (Sandbox Code Playgroud)
为此创建表的 postgres 命令是什么?目前我有这个,它在 附近给出了语法错误(
。
创建表操作(id bigint NOT NULL,名称文本,json,唯一(名称,有效负载::json#>>'{消息,有效负载,内容}'));
我也尝试过
CREATE TABLE action (
id bigint NOT NULL,
name text,
a json
);
ALTER TABLE actions ADD CONSTRAINT actions_constraint UNIQUE (payload::json#>>'{b, c, d}', name);
Run Code Online (Sandbox Code Playgroud)
这一直给我这个错误:
ERROR: syntax error at or near "::"
Run Code Online (Sandbox Code Playgroud)
我怎样才能创建这个约束?
我试图将我的正则表达式匹配的命名组分配给局部变量。例如,我试图捕获日期输入的字符串并引用命名组month
和day
局部变量:
input = "2015-01-24"
expr = /\d{4}-(?<month>\d{2})-(?<day>\d{2})/
input =~ expr #=> 0
Run Code Online (Sandbox Code Playgroud)
但是,month
或者day
是匹配后未定义的变量。我如何访问month
和day
作为局部变量?
根据Ruby doc,输入组变量名称将返回捕获的值(在本例中为“美元”)
/\$(?<dollars>\d+)\.(?<cents>\d+)/ =~ "$3.67" #=> 0
dollars #=> "3"
Run Code Online (Sandbox Code Playgroud)
我也很感激任何推荐的资源。
在开发过程中,我使用类似
$ adb -s 192.168.1.77:5555 uninstall com.myApp.app
$ adb -s 192.168.1.77:5555 install /path/to/android-debug.apk
Run Code Online (Sandbox Code Playgroud)
卸载现有应用程序,然后将更新的应用程序推送并安装到我的设备。但是,这似乎会删除与应用程序关联的现有数据,因此每次运行更新的应用程序时,我都需要再次输入新数据。但是,只需运行安装命令即可:
[ 10%] /data/local/tmp/android-debug.apk
[100%] /data/local/tmp/android-debug.apk
pkg: /data/local/tmp/android-debug.apk
Failure [INSTALL_FAILED_ALREADY_EXISTS]
Run Code Online (Sandbox Code Playgroud)
使用 iOS,您只需在设备上的现有应用程序上安装更新的应用程序即可。
最好使用 Android 的等效项是什么adb
?
编辑:这个问题确实是类似于这一个,但我认为这应该保持,因为我的问题是措辞的方式将帮助许多人试图找到从不同的角度-该角度重新安装的未来的答案/覆盖与更新。
我有我的MacOS时自动从开始v6.10.0节点服务器CMD
中Dockerfile
。通常在我的本地开发非容器化环境中,我将使用 CTRL+C 来终止服务器。无法(或不知道如何)在容器中执行此操作,我求助于ps aux | grep node
尝试手动终止进程。所以,我得到这样的东西:
myapp [master] :> kubectl exec -it web-3127363242-xb50k bash
root@web-3127363242-xb50k:/usr/src/app# ps aux | grep node
root 15 0.4 0.9 883000 35804 ? Sl 05:49 0:00 node /usr/src/app/node_modules/.bin/concurrent --kill-others npm run start-prod npm run start-prod-api
root 43 0.1 0.6 743636 25240 ? Sl 05:49 0:00 node /usr/src/app/node_modules/.bin/better-npm-run start-prod
root 44 0.1 0.6 743636 25140 ? Sl 05:49 0:00 node /usr/src/app/node_modules/.bin/better-npm-run start-prod-api
root 55 0.0 0.0 4356 740 ? S …
Run Code Online (Sandbox Code Playgroud) 尝试通过以下方式启动 Elasticsearch 5.1.1 时
$ elasticsearch
我得到输出:
Error: Could not find or load main class -Xms2g
我调查过:
我是通过 Homebrew 安装的。这是其中的一些输出:
$ brew info elasticsearch
elasticsearch: stable 5.1.1, HEAD
Distributed search & analytics engine
https://www.elastic.co/products/elasticsearch
Conflicts with: elasticsearch@1.7, elasticsearch@2.4
/usr/local/Cellar/elasticsearch/5.1.1 (98 files, 35.2M) *
Built from source on 2016-12-14 at 09:23:56
From: https://github.com/Homebrew/homebrew-core/blob/master/Formula/elasticsearch.rb
==> Requirements
Required: java >= 1.8 ?
==> Caveats
Data: /usr/local/var/elasticsearch/elasticsearch_GabbAHH/
Logs: /usr/local/var/log/elasticsearch/elasticsearch_GabbAHH.log
Plugins: /usr/local/Cellar/elasticsearch/5.1.1/libexec/plugins/
Config: /usr/local/etc/elasticsearch/
plugin script: /usr/local/Cellar/elasticsearch/5.1.1/libexec/bin/plugin
To have launchd start elasticsearch …
Run Code Online (Sandbox Code Playgroud)docker ×2
kubernetes ×2
node.js ×2
redis ×2
vue.js ×2
adb ×1
android ×1
bash ×1
css ×1
homebrew ×1
html ×1
java ×1
javascript ×1
linux ×1
macos-sierra ×1
postgresql ×1
pug ×1
regex ×1
ruby ×1
shadow-dom ×1
shell ×1
sql ×1
tcp ×1
vuejs2 ×1