小编dec*_*dec的帖子

在Chrome中调试.vue组件

是否可以在Chrome中调试.vue组件。到目前为止,我只得到了橙色标记的源代码,而chrome没有记录调试信息,即无法检查变量等。

如何做到这一点?

javascript debugging google-chrome vue.js

5
推荐指数
1
解决办法
4337
查看次数

将 div 内旋转的 div 垂直居中

我不明白;-(

我想将一个 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)

绘

html css

4
推荐指数
2
解决办法
3895
查看次数

angularjs组件与动态templateUrl

是否可以使用动态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)

javascript angularjs

4
推荐指数
2
解决办法
4857
查看次数

使用 TypeScript 在 AngularJS 中实现 Provider

我尝试使用依赖于服务的 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)

typescript

1
推荐指数
1
解决办法
2545
查看次数