我很乐意使用BrowserSync进行开发.但是,页面加载(不仅仅是在更改后重新加载)非常慢.
我用的是proxy
模式.在没有BrowserSync的情况下浏览页面应该很快.
安装BrowserSync时,一个原因可能是以下错误:
> ws@0.4.31 install /usr/local/lib/node_modules/browser-sync/node_modules/socket.io/node_modules/engine.io/node_modules/ws
> (node-gyp rebuild 2> builderror.log) || (exit 0)
CXX(target) Release/obj.target/bufferutil/src/bufferutil.o
SOLINK_MODULE(target) Release/bufferutil.node
SOLINK_MODULE(target) Release/bufferutil.node: Finished
CXX(target) Release/obj.target/validation/src/validation.o
SOLINK_MODULE(target) Release/validation.node
SOLINK_MODULE(target) Release/validation.node: Finished
Run Code Online (Sandbox Code Playgroud)
我从头开始安装节点(使用brew
和包安装程序),但无法摆脱错误.
此外,如果使用Gulp或命令行运行BrowserSync,则没有任何区别.
任何的想法?
在模板助手中,我从Iron.Router(iron:router
)获取当前路径,如下所示:
Router.current().route.path()
Run Code Online (Sandbox Code Playgroud)
这工作正常,除非路径路径确实包含参数(例如/client/:_id/edit
).在那种情况下,path()
函数返回null
.
当路由包含参数时,如何获取模板助手中的当前路径?
我正在使用Meteor 1.0和iron:router
1.0.1
是否可以在TYPO3 Fluid模板中获取当前语言键(或代码)?
与此同时,我发现了另一种使用此处的视图助手的解决方案:
<?php
class Tx_AboUnitReservation_ViewHelpers_LanguageViewHelper extends Tx_Fluid_Core_ViewHelper_AbstractViewHelper {
/**
* Get the current language
*/
protected function getLanguage() {
if (TYPO3_MODE === 'FE') {
if (isset($GLOBALS['TSFE']->config['config']['language'])) {
return $GLOBALS['TSFE']->config['config']['language'];
}
} elseif (strlen($GLOBALS['BE_USER']->uc['lang']) > 0) {
return $GLOBALS['BE_USER']->uc['lang'];
}
return 'en'; //default
}
/**
* Return current language
* @return string
*/
public function render() {
return $this->getLanguage();
}
}
?>
Run Code Online (Sandbox Code Playgroud)
我在流体模板中使用如下.
<f:alias map="{isGerman: 'de'}">
<f:if condition="{aboUnitReservation:language()} == {isGerman}">
<script type="text/javascript" src="{f:uri.resource(path:'js/jquery.ui.datepicker-de-CH.js')}"></script>
</f:if>
</f:alias>
Run Code Online (Sandbox Code Playgroud) 我不明白,应该如何在angular2中以模型驱动的形式处理复选框组.
该模型有一个languages
我实例化的属性,如下所示:
this.model = {
languages: []
};
Run Code Online (Sandbox Code Playgroud)
使用FormBuilder
创建的形式:
this.modelForm = this.formBuilder.group({
'languages': [model.languages, Validators.required],
});
Run Code Online (Sandbox Code Playgroud)
和模板:
<div *ngFor="let language of translateService.get('languages') | async | key_value">
<input type="checkbox" name="languages[]" formControlName="languages" value="{{ language.key }}" id="language_{{ language.key }}">
<label attr.for="language_{{ language.key }}">{{ language.value }}</label>
</div>
Run Code Online (Sandbox Code Playgroud)
在div
需要对造型的目的(定制复选框),key_value
使按键和循环使用的语言,明显的价值.
第一个问题来自验证.如果检查并取消选中一个复选框(并且未选中其他复选框),则输入仍然有效 - 不知何故很奇怪.
第二个问题伴随着价值,即true
如果检查两种或更多种语言,则false
另外.
然后有第三个问题,其初始值languages
只是一个空数组,但会导致所有复选框最初被检查(如果初始值设置为a string
,则不会发生),尽管我无法发现任何checked
属性DOM.
我正在使用最新的离子beta(2.0.0-beta.10),它使用角度/核心版本2.0.0-rc.4和角度/形式版本0.2.0.
那么,有没有关于如何使用复选框组的指南?有什么建议或想法吗?
我想@Messages
在NetBeans中使用注释来简化我的应用程序中的本地化.但是,我找不到任何有关如何使用此机制为其他语言添加翻译(包)的信息.
使用的动作示例@Messages
如下
@ActionID(category = "category",
id = "AddAction")
@ActionRegistration(iconBase = "actions/action-icon.png",
displayName = "#CTL_AddAction")
@ActionReferences({
@ActionReference(path = "Menu/Shapes", position = 160),
@ActionReference(path = "Toolbars/Shapes", position = 5133)
})
@Messages("CTL_AddAction=Add Action")
Run Code Online (Sandbox Code Playgroud)
如何根据语言改变添加操作?
netbeans localization internationalization netbeans-platform netbeans-7
我遇到了浏览器缓存干扰我的Laravel应用程序的问题.
如果禁用浏览器缓存,一切正常.但是,如果启用,并且重复单击相同的链接,则甚至不会执行用于创建视图或收集数据的Laravel方法.
其影响是多方面的.例如,编辑资源的表单或显示数据的网格(使用ajax从服务器加载)在重新加载浏览器之前不会显示当前值.
我在我的一些方法中添加了一行记录当前时间戳以证明这一点.
public function index()
{
Log::info( microtime() );
return View::make( $this->templates_root . 'index' );
}
Run Code Online (Sandbox Code Playgroud)
当重复单击链接或再次访问视图时,日志中不会显示任何行.但是如果我重新加载浏览器就会这样.
我该怎么做才能阻止浏览器缓存我的观点?
当我把它放在我的 Vue 组件中时......
// using store getter
computed: {
authenticated() {
return this.$store.getters.authenticated
}
}
Run Code Online (Sandbox Code Playgroud)
... 有用。的值authenticated
是响应式的,true
当 vuex 存储中的值为 时,计算属性返回true
。
这应该有效......(并且根据文档将是正确的方法)
// using store state
computed: {
authenticated() {
return this.$store.state.authenticated
}
}
Run Code Online (Sandbox Code Playgroud)
......但没有。计算属性始终为false
。
它甚至不适用于初始状态,所以我猜它与动作或突变无关。vuex 存储在state
和getters
(Firefox Vue DevTools) 中保存正确的值。
我的商店看起来像这样:
const state = {
authenticated: authenticate.isAuthenticated(),
};
const getters = {
authenticated () {
return state.authenticated
}
};
const mutations = {
isAuthenticated (state, isAuthenticated) {
state.authenticated = …
Run Code Online (Sandbox Code Playgroud) 我尝试server.xml
在我的jpa-spring.xml
文件中的'PropertyPlaceholderConfigurer' 中获取Tomcat 中指定的Environment变量.
到目前为止,设置如下:
Tomcat的 server.xml
<Environment description="Identifies the server environement"
name="server-env"
type="java.lang.String"
value="dev" />
Run Code Online (Sandbox Code Playgroud)
在WebContent/META-INF/context.xml
:
<Context>
<ResourceLink name="server-env" global="server-env" type="java.lang.String"/>
</Context>
Run Code Online (Sandbox Code Playgroud)
哪个引用WebContent/WEB-INF/web.xml
如下:
<resource-env-ref>
<description>Identifies server environement</description>
<resource-env-ref-name>server-env</resource-env-ref-name>
<resource-env-ref-type>java.lang.String</resource-env-ref-type>
</resource-env-ref>
<!-- Spring Integration -->
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>
/WEB-INF/config/jpa-spring.xml
</param-value>
</context-param>
Run Code Online (Sandbox Code Playgroud)
在/WEB-INF/config/jpa-spring.xml
我尝试将该变量作为替代品:
<bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="locations">
<list>
<value>WEB-INF/config/db.${server-env}.properties</value>
</list>
</property>
</bean>
Run Code Online (Sandbox Code Playgroud)
这是我使用网上发现的几篇文章中的信息整理的设置.
但是,我得到一个像......的错误
Could not resolve placeholder 'server-env' in [WEB-INF/config/db.${server-env}.properties] as system property: neither system property nor environment variable found
05 …
Run Code Online (Sandbox Code Playgroud) 我尝试使用opentok JS客户端创建一个屏幕共享应用程序,该客户端也共享发布者音频.
屏幕共享工作正常.但音频永远不会共享.
现在,我注意到控制台(Firefox)中的警告说Invalid audioSource passed to Publisher - when using screen sharing no audioSource may be used
.这是否意味着根本不可能,或音频源无效?
我正在寻找一种在开发机器上使用Laravel Mix构建资产的方法,该方法随后将与生产中的参数匹配。
例如,我的API有一个基本URL,http://foo.test/api/v1
用于本地开发和https://foo.com/api/v1
生产服务器上。
因此,在我的客户代码(例如http.js
)中,我想执行以下操作:
Vue.axios.defaults.baseURL = API_BASE_URL;
Run Code Online (Sandbox Code Playgroud)
现在,API_BASE_URL
应该会被替换成http://foo.test/api/v1
我运行时npm run dev
或https://foo.com/api/v1
当我运行npm run prod
。
我已经尝试了以下无效的方法。
webpack.mix.js
mix.webpackConfig(webpack => {
return {
plugins: [
new webpack.DefinePlugin({
API_BASE_URL: JSON.stringify('https://foo.com/api/v1'),
})
]
}
});
Run Code Online (Sandbox Code Playgroud)
然后在http.js中
Vue.axios.defaults.baseURL = API_BASE_URL;
Run Code Online (Sandbox Code Playgroud)
编译为:
Object({"NODE_ENV":"production"}).API_BASE_URL;
我也尝试过这种方法process.env.API_BASE_URL
。
我有一个如下所示的URL:
http://domain.com/leistungen/industrial-design/?tx_fsproject_fsprojectfp%5Bproject%5D=2&tx_fsproject_fsprojectfp%5Baction%5D=show&tx_fsproject_fsprojectfp%5Bcontroller%5D=Project&cHash=7c405bcde49853af9a7e78bdf465002c
Run Code Online (Sandbox Code Playgroud)
使用具有以下配置的RealURL(以及此处说明的一些钩子函数):
'postVarSets' => array(
'_DEFAULT' => array(
// projects
'industrial-design' => array(
array(
'GETvar' => 'tx_fsproject_fsprojectfp[controller]',
),
array(
'GETvar' => 'tx_fsproject_fsprojectfp[action]',
),
array(
'GETvar' => 'tx_fsproject_fsprojectfp[project]',
'lookUpTable' => array(
'table' => 'tx_fsproject_domain_model_project',
'id_field' => 'uid',
'alias_field' => 'title',
'addWhereClause' => ' AND deleted !=1 AND hidden !=1',
'useUniqueCache' => 1,
'useUniqueCache_conf' => array(
'strtolower' => 1,
'spaceCharacter' => '-',
)
)
),
),
),
),
Run Code Online (Sandbox Code Playgroud)
我得到一个如下所示的网址:
http://domain.com/leistungen/industrial-design/industrial-design/projekt/project-b/
Run Code Online (Sandbox Code Playgroud)
这不错.但是,为什么这部industrial-design/
分会出现两次?
我的Fine Uploader实现-使用核心模式和jQuery-可以正常工作,直到我尝试上传第二批文件。
当第一批文件成功上传后,我可以单击按钮添加文件,然后弹出对话框选择文件。但是,在确认文件选择后,什么也没有发生。
complete
处理程序中的以下代码引起了问题:
$('#attachments-upload').button('reset'); // Bootstrap stateful button
Run Code Online (Sandbox Code Playgroud)
#attachments-upload
是也设置为button:
选项的按钮的ID 。这是完整的JS代码清单:
$('#attachments-list').fineUploader({
uploaderType: 'basic',
button: $('#attachments-upload'),
debug: true,
request: {
endpoint: $route_atatachments_upload,
inputName: 'attachments'
},
validation: {
allowedExtensions: ['png', 'jpeg', 'gif', 'pdf', 'doc', 'bmp'],
sizeLimit: 10485760 // 10MB
}
})
.on('upload', function(event, id, fileName) {
$('#attachments-upload-error').hide();
$('#attachments-upload').button('loading');
$('#attachments-upload-progress').show().attr('aria-valuenow', 0);
})
.on('progress', function(event, id, fileName, loaded, total) {
if (loaded < total) {
var progress = Math.round(loaded / total * 100) + '% of ' + Math.round(total …
Run Code Online (Sandbox Code Playgroud) typo3 ×2
angular ×1
browser ×1
browser-sync ×1
caching ×1
fluid ×1
hibernate ×1
ionic2 ×1
iron-router ×1
java ×1
laravel ×1
laravel-4 ×1
laravel-mix ×1
localization ×1
meteor ×1
netbeans ×1
netbeans-7 ×1
node.js ×1
opentok ×1
performance ×1
php ×1
realurl ×1
spring ×1
sync ×1
tokbox ×1
vue.js ×1
vuex ×1
webpack ×1