是否可以在Chrome中调试.vue组件。到目前为止,我只得到了橙色标记的源代码,而chrome没有记录调试信息,即无法检查变量等。
如何做到这一点?
我不明白;-(
我想将一个 div 与另一个 div 中包含的文本居中。内部 div 旋转 90 度。到现在为止还挺好。我的问题是我无法让内部 div 与外部 div 的左侧水平对齐。如何才能做到这一点?
HTML:
<div class="outer">
<div class="inner">
12345678901234567890
</div>
</div>
Run Code Online (Sandbox Code Playgroud)
CSS:
div {
border: 1px solid red;
}
.outer {
position: absolute;
top: 0px;
height: 300px;
width: 30px;
}
.inner {
transform: translateX(-50%) translateY(-50%) rotate(90deg);
margin-left: 10px;
position: relative;
top: 50%;
text-align: center;
}
Run Code Online (Sandbox Code Playgroud)

是否可以使用动态templateUrl创建AngularJS组件?意味着我想将一个服务注入到组件中,该组件为我提供了模板的基本路径:
即:templateUrl:configuration.baseScriptPath +'... html'
有可能使用指令,但如何使用组件执行此操作?
angular.module('runtime')
.component('textInput', {
templateUrl: /*configuration.baseScriptPath + */'fd/components/text_input_instance.html',
controller: [
'$scope', '$element', 'focusInputGroup', 'configuration',
function ($scope, $element, focusInputGroup, configuration) {
Run Code Online (Sandbox Code Playgroud) 我尝试使用依赖于服务的 TypeScript 来实现提供者。我想我必须将这些服务注入到 get 函数中,但这在 TypeScript 中是如何完成的?
在 JavaScript 中,它是这样实现的:
angular.module('HTML5Shell.Services')
.provider('service', [
'baseService',
function (baseService) {
return {
$get: ['$rootScope',
function ($rootScope) {
return {
method: function (param) {
return 'method called';
}
};
}]
};
}]);
Run Code Online (Sandbox Code Playgroud)