RError.com

RError.com Logo RError.com Logo

RError.com Navigation

  • 主页

Mobile menu

Close
  • 主页
  • 系统&网络
    • 热门问题
    • 最新问题
    • 标签
  • Ubuntu
    • 热门问题
    • 最新问题
    • 标签
  • 帮助
主页 / user-278411

Aleksey exec's questions

Martin Hope
Aleksey exec
Asked: 2020-07-26 03:35:03 +0000 UTC

如何添加我遵循的 routerLink 类

  • 0

这个想法是,当我点击链接时,<nav routerLink="" class="pages__link"> 我需要添加一个类 .active{color: red},告诉用户他在这个页面上,当他转到另一个页面时,这个类将从这个页面中删除并分配给另一个,等等......

在jquery中它看起来像这样

$('.el').on('click', function() {
   $('.el').css({ color: 'black' })
   $(this).css({ color: 'red' })
})

但我不仅想为链接分配一个类,而是在路由器成功完成NavigationEnd之后,即作为对成功事件的回调,并将类分配给*( routerLink )*用户单击的链接?

app.component.html

<header class="df jcc aic">
  <nav class="page df jcc aic">
      <nav  routerLink="" class="pages__link">{{ 'home' | uppercase }}</nav>
      <nav  routerLink="about" class="pages__link">{{ 'about' | uppercase }}</nav>
      <nav  routerLink="galery" class="pages__link">{{ 'galery' | uppercase }}</nav>
  </nav>
</header>
 <div class="container" [@fadeAnimation]="o.isActivated ? o.activatedRoute : ''">
   <router-outlet #o="outlet"></router-outlet>
 </div>

应用程序路由.module.ts

export const routes: Routes = [
    { path: '', component: HomeComponent },
    { path: 'about', component: AboutComponent },
    { path: 'galery', component: GaleryComponent }
];
маршрутизация
  • 1 个回答
  • 10 Views
Martin Hope
Aleksey exec
Asked: 2020-07-25 23:52:13 +0000 UTC

如何模拟路由器延迟

  • 2

<nav routerLink="" class="pages__link"> 怎么模拟路由器点击的延迟以及进入多少秒,甚至从点击到页面加载做某种回调,这样我就可以放一个应用,写一些样式

app.component.html

<header class="df jcc aic">
  <nav class="page df jcc aic">
      <nav routerLink="" class="pages__link">{{ 'home' | uppercase }}</nav>
      <nav routerLink="about" class="pages__link">{{ 'about' | uppercase }}</nav>
      <nav routerLink="galery" class="pages__link">{{ 'galery' | uppercase }}</nav>
  </nav>
</header>
 <div class="container" [@fadeAnimation]="o.isActivated ? o.activatedRoute : ''">
   <router-outlet #o="outlet"></router-outlet>
 </div>

应用程序路由.module.ts

export const routes: Routes = [
        { path: '', component: HomeComponent },
        { path: 'about', component: AboutComponent },
        { path: 'galery', component: GaleryComponent }
    ];
маршрутизация
  • 1 个回答
  • 10 Views
Martin Hope
Aleksey exec
Asked: 2020-07-24 23:37:37 +0000 UTC

如何使用 ngFor 仅显示前 4 个项目

  • 1

items数组中有 10 个对象,我只需要使用 size 变量显示前 4 个对象

app.component.html

<div class="prod-section">
  <div  *ngFor="let item of items">
    <h1>{{ item.id }}</h1>
    <p>{{ item.name }}</p>
  </div>
</div>

app.component.ts

  size: number = 4;

  items = [
      { id: 1, name: 'плитка' },
      { id: 2, name: 'плитка' },
      { id: 3, name: 'плитка' },
      { id: 4, name: 'плитка' },
      { id: 5, name: 'плитка' },
      { id: 6, name: 'плитка' },
      { id: 7, name: 'плитка' },
      { id: 8, name: 'плитка' },
      { id: 9, name: 'плитка' },
      { id: 10, name: 'плитка' },
  ];
angular5
  • 1 个回答
  • 10 Views
Martin Hope
Aleksey exec
Asked: 2020-07-20 16:13:47 +0000 UTC

将鼠标悬停在一个元素上时,更改另一个元素的类?

  • 0

我创建了指令。

import { Directive, HostBinding, HostListener } from '@angular/core';

@Directive({
  selector: '[appHover]'
})


export class HoverDirective {

    @HostBinding( 'class.under' ) isunder = false;



    @HostListener( 'mouseenter' ) OnEnter(){
      this.isunder = true
    }

    @HostListener( 'mouseleave' ) OnLeave(){
      this.isunder = false
    }

}

将鼠标悬停在第一个导航上时

  <nav appHover> nav 1</nav>
  <nav> nav 2</nav>

样式应用于它

.under
    text-decoration: underline

如何将悬停在第一个导航上应用样式到第二个导航?

angular5
  • 1 个回答
  • 10 Views
Martin Hope
Aleksey exec
Asked: 2020-07-17 02:03:40 +0000 UTC

如何正确地将 sass 变量连接到 Angular 6

  • 0

有一个_variables.sass文件存储所有全局变量,但它们不适用于组件。是否会在每个组件中正确连接这些变量? @import "variables"

sass
  • 1 个回答
  • 10 Views
Martin Hope
Aleksey exec
Asked: 2020-07-14 22:58:09 +0000 UTC

如何排除文件夹但推送其内容?

  • 2

有这样的结构


  • 距离

    • 零件

      • 文件 1

      • 文件2

  • .gitignore


如何配置 gitignore以使用git push获得这样的结构


  • 文件 1
  • 文件2
  • .gitignore
git
  • 1 个回答
  • 10 Views
Martin Hope
Aleksey exec
Asked: 2020-07-10 22:49:30 +0000 UTC

如何让块一个接一个地出现?

  • 0

在products_section部分,产品块是通过循环加载的, 我希望它们一个一个平滑地出现,例如opacity: 0; 变得不透明度:1;

<style>
   header.header{
    background: #000;
    width: 100%;
    display: flex;
    justify-content: center;
   }
   .products_section{
    margin: 0 auto;
    width: 70%;
   }
   .product{
    padding: 10px;
    margin: 10px;
    text-align: center;
    background: #e8e8e8;
    width: 500px;
    margin: 20px auto;

   }
   
   .product {
    opacity: 1;
}

.product.ng-enter {
    transition: 1s linear all;
    opacity: 0;
}

.product.ng-enter-active {
    opacity: 1;
}
</style>



<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.7/angular.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.4.7/angular-animate.min.js"></script>
<script>


        var countryApp = angular.module('countryApp', ['ngAnimate']);
        countryApp.controller('CountryCtrl', function ($scope, $http){
            $http.get('https://raw.githubusercontent.com/coffeehoock/API/master/products.json').success(function(data) {
                $scope.countries = data;
            });
        });
</script>


<body ng-controller="CountryCtrl" ng-app="countryApp">

    <header class="header">
        <button>up</button>
        <button>down</button>
    </header>

        <!--TEMPLATE-->
        <div id="products_section">
            
            <div class="product" ng-repeat="country in countries | orderBy: '-priceGoldAlt' ">
                
                
                <div class="title">{{ country.title }}</div>
                
                <div class="priceGoldAlt">ЦЕНА {{ country.priceGoldAlt }}</div>
                
                           
            </div>
        </div>
        <!--TEMPLATE-->

angularjs
  • 1 个回答
  • 10 Views
Martin Hope
Aleksey exec
Asked: 2020-07-10 17:58:26 +0000 UTC

如何将一种样式分配给多个类?

  • 1

有两个班

.product
   &__price--gold
       margin-bottom: 15px

   &__price--retail
       margin-bottom: 10px

他们都应该有font-size: 100px

我可以这样写

.product
   &__price--gold
       margin-bottom: 15px

   &__price--retail
       margin-bottom: 10px

   &__price--gold ,&__price--retail
       font-size: 100px

但这已经很长时间了,处理器中是否有任何方法可以使它更容易,例如,像这样的东西?

.product
   &__price--(*)
       font-size: 100px
sass
  • 1 个回答
  • 10 Views
Martin Hope
Aleksey exec
Asked: 2020-07-08 03:02:46 +0000 UTC

如何对从 JSON 接收的对象进行排序

  • 1

data如何对从 JSON 获得的对象数组进行排序。

获取产品.js

var data = [{
  "id": "0",
  "name": "stul"
}, {
  "id": "1",
  "name": "stol"
}, {
  "id": "4",
  "name": "json"
}]



  var productData;
  productData = data;
  
  $.each(productData, function(i, prod) {
    $('#products_section').append("<div>" + prod.id + "</div><div>" + prod.name + "</div>");
  });
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div id="products_section"></div>

我如何按id从大到小或按名称对它们进行排序?

javascript
  • 1 个回答
  • 10 Views
Martin Hope
Aleksey exec
Asked: 2020-07-07 04:14:18 +0000 UTC

如何解析json文件

  • 0

有一个products.json文件

[
 {
  "id": 1,
  "name": "stul"
 }
 {
  "id": 2,
  "name": "stol"
 }
]

这是布局

<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
      <div class="product-container">
          <div class="product">
              <div class="id"></div>
              <div class="name"></div>
          </div>
      </div>
</body>
</html>

inproduct-container应该插入product ,但是其中可能有很多如何使用jquery将所有产品解析为 html或者如果有 1000 个产品基本上是个坏主意?

javascript
  • 2 个回答
  • 10 Views
Martin Hope
Aleksey exec
Asked: 2020-04-08 00:18:36 +0000 UTC

如何在 symfony 中实现反馈表

  • 1

如何在symfony中实现一个反馈表,将用户的电话号码发送到邮件中,是否可以通过控制台做到这一点

php app/console

我想要更多的例子细节,因为我在symfony中完全是零 ,我不知道那里的一切是如何工作的——除了树枝模板

php
  • 1 个回答
  • 10 Views
Martin Hope
Aleksey exec
Asked: 2020-04-07 15:06:40 +0000 UTC

如何设置php邮件

  • 0

在apache服务器上创建mail.php文件

var_dump( mail("myemail@gmail.com" ,"Test","Test") );

页面显示bool(false) 了,信没有来,我该如何解决这个问题?以及如何了解问题出在apache设置或php 中的模块中未安装的东西?

php
  • 2 个回答
  • 10 Views
Martin Hope
Aleksey exec
Asked: 2020-03-26 03:54:41 +0000 UTC

如何移动除少数几个文件夹之外的所有文件夹?

  • 1

如何使用linux控制台 使用 mv 命令将除某些文件夹之外的所有文件夹移动到另一个目录?

linux
  • 3 个回答
  • 10 Views
Martin Hope
Aleksey exec
Asked: 2020-03-18 02:15:54 +0000 UTC

如何在 Symfony 4.0.6 中建立数据库连接

  • 1

在哪个文件中以及要写入mysql 的内容,这就是在控制台中在水中时显示的内容

php bin/控制台 --version

4.0.6 (kernel: src, env: dev, debug: true)
php
  • 1 个回答
  • 10 Views
Martin Hope
Aleksey exec
Asked: 2020-03-12 01:19:42 +0000 UTC

平滑拉伸 div

  • 2

使用ajax将其他div添加到.message类的div容器中 如何在添加新元素时使.message容器 沿内容高度平滑拉伸?

javascript
  • 2 个回答
  • 10 Views
Martin Hope
Aleksey exec
Asked: 2020-03-11 04:29:52 +0000 UTC

如何删除主键?

  • 1

注释表已创建,但随后决定不需要 PRIMARY KEY 参数

CREATE TABLE comments(
    id INT PRIMARY KEY,
);

如何从id列中删除PRIMARY KEY ?

mysql
  • 1 个回答
  • 10 Views
Martin Hope
Aleksey exec
Asked: 2020-03-09 16:02:50 +0000 UTC

如何将函数参数传递给另一个函数?

  • 0
class A {

    public function b($val) {
    }

    public function c() {
    }
}

如何使用普通方法和静态方法将参数$val从函数 b传递给函数 c ?

class A {

    public static function b($val) {
    }

    public static function c() {
    }
}
php
  • 1 个回答
  • 10 Views
Martin Hope
Aleksey exec
Asked: 2020-03-08 17:42:36 +0000 UTC

如何通过方法实现方法调用?

  • 2

有时我会看到这段代码

$a = new A;
$a->method1()->method2();

如何实现method2,它本质上是闭包还是回调?

php
  • 1 个回答
  • 10 Views
Martin Hope
Aleksey exec
Asked: 2020-03-03 19:03:51 +0000 UTC

不正确的coffeescript编译

  • 0

使用此代码

咖啡脚本

A 类构造函数: (@name, @age) ->

放弃它

var A;

A = class A {
  constructor(name, age) {
    this.name = name;
    this.age = age;
  }

};

之前

var A;

A = (function() {
  function A(name, age) {
    this.name = name;
    this.age = age;
  }

  return A;

})();

如何返回这种编译变体?

这是package.json

{
  "name": "gulp.dev",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "author": "",
  "license": "ISC",
  "devDependencies": {
    "browser-sync": "^2.23.6",
    "coffee-script": "^1.12.7",
    "gulp": "^3.9.1",
    "gulp-autoprefixer": "^4.1.0",
    "gulp-cached": "^1.1.1",
    "gulp-coffee": "^3.0.2",
    "gulp-coffeescript": "0.0.15",
    "gulp-concat": "^2.6.1",
    "gulp-debug": "^3.2.0",
    "gulp-group-css-media-queries": "^1.2.2",
    "gulp-notify": "^3.2.0",
    "gulp-remember": "^1.0.1",
    "gulp-sass": "^3.1.0",
    "gulp-sourcemaps": "^2.6.4",
    "smart-grid": "^2.0.1"
  }
}

和gulpfile.js

const gulp          = require('gulp');
const browserSync   = require('browser-sync').create();
const concat        = require('gulp-concat');
const debug         = require('gulp-debug');
const sourcemaps    = require('gulp-sourcemaps');
const autoprefixer  = require('gulp-autoprefixer');
const remember      = require('gulp-remember');
const cached        = require('gulp-cached');
const notify        = require("gulp-notify");

const sass          = require('gulp-sass');
const coffee        = require('gulp-coffee');

const gcmq          = require('gulp-group-css-media-queries');


gulp.task('sass', function(){
    gulp.src('./source/style.sass')

    .pipe(cached('sass'))
    .pipe(remember('sass'))
    .pipe(debug({title: "sass"}))
    .pipe(sass({outputStyle: 'expanded'})).on('error', notify.onError())
    .pipe(gcmq())
    .pipe(gulp.dest('./production/css/')).resume()
});

gulp.task('coffee', function(){
     gulp.src('./source/main.coffee')

    .pipe(cached('coffee'))
    .pipe(remember('coffee'))
    .pipe(debug({title: "coffee"}))
    .pipe(coffee({bare: true})).on('error', notify.onError())
    .pipe(gulp.dest('./production/js/')).resume()
});


gulp.task('autoprefixer', function () {
    gulp.src('production/css/style.css')
    .pipe(autoprefixer({
        browsers: ['last 5 versions'],
        cascade: false
    }))
    .pipe(gulp.dest('production/css/'));
});

gulp.task('watch', function(){
    gulp.watch("./source/style.sass", ['sass'])
    gulp.watch("./source/main.coffee", ['coffee'])
    gulp.watch("production/css/style.css", ['autoprefixer'])
});


gulp.task('serve', function() {

    browserSync.init({
        proxy: "gulp.su"

    });
    browserSync.watch("*.*").on('change', browserSync.reload);
    browserSync.watch("./production/**/*.*").on('change', browserSync.reload);
});

gulp.task('default', ['watch', 'serve']);
javascript
  • 1 个回答
  • 10 Views
Martin Hope
Aleksey exec
Asked: 2020-02-23 18:22:17 +0000 UTC

如何解决jquery版本冲突

  • 3

有一个插件使用简码加载到页面上,它使用自己的jquery版本,主题使用自己的,结果,插件在较新版本的jquery上不起作用,我该如何解决这个问题不放弃新版 jquery

现在在文件functions.php中,连接看起来像这样

wp_enqueue_script( 'test-themes-jquery', get_template_directory_uri() . '/js/jquery-3.3.1.min.js', array(), '3.3.1', true );
jquery
  • 1 个回答
  • 10 Views

Sidebar

Stats

  • 问题 10021
  • Answers 30001
  • 最佳答案 8000
  • 用户 6900
  • 常问
  • 回答
  • Marko Smith

    我看不懂措辞

    • 1 个回答
  • Marko Smith

    请求的模块“del”不提供名为“default”的导出

    • 3 个回答
  • Marko Smith

    "!+tab" 在 HTML 的 vs 代码中不起作用

    • 5 个回答
  • Marko Smith

    我正在尝试解决“猜词”的问题。Python

    • 2 个回答
  • Marko Smith

    可以使用哪些命令将当前指针移动到指定的提交而不更改工作目录中的文件?

    • 1 个回答
  • Marko Smith

    Python解析野莓

    • 1 个回答
  • Marko Smith

    问题:“警告:检查最新版本的 pip 时出错。”

    • 2 个回答
  • Marko Smith

    帮助编写一个用值填充变量的循环。解决这个问题

    • 2 个回答
  • Marko Smith

    尽管依赖数组为空,但在渲染上调用了 2 次 useEffect

    • 2 个回答
  • Marko Smith

    数据不通过 Telegram.WebApp.sendData 发送

    • 1 个回答
  • Martin Hope
    Alexandr_TT 2020年新年大赛! 2020-12-20 18:20:21 +0000 UTC
  • Martin Hope
    Alexandr_TT 圣诞树动画 2020-12-23 00:38:08 +0000 UTC
  • Martin Hope
    Air 究竟是什么标识了网站访问者? 2020-11-03 15:49:20 +0000 UTC
  • Martin Hope
    Qwertiy 号码显示 9223372036854775807 2020-07-11 18:16:49 +0000 UTC
  • Martin Hope
    user216109 如何为黑客设下陷阱,或充分击退攻击? 2020-05-10 02:22:52 +0000 UTC
  • Martin Hope
    Qwertiy 并变成3个无穷大 2020-11-06 07:15:57 +0000 UTC
  • Martin Hope
    koks_rs 什么是样板代码? 2020-10-27 15:43:19 +0000 UTC
  • Martin Hope
    Sirop4ik 向 git 提交发布的正确方法是什么? 2020-10-05 00:02:00 +0000 UTC
  • Martin Hope
    faoxis 为什么在这么多示例中函数都称为 foo? 2020-08-15 04:42:49 +0000 UTC
  • Martin Hope
    Pavel Mayorov 如何从事件或回调函数中返回值?或者至少等他们完成。 2020-08-11 16:49:28 +0000 UTC

热门标签

javascript python java php c# c++ html android jquery mysql

Explore

  • 主页
  • 问题
    • 热门问题
    • 最新问题
  • 标签
  • 帮助

Footer

RError.com

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

帮助

© 2023 RError.com All Rights Reserve   沪ICP备12040472号-5