RError.com

RError.com Logo RError.com Logo

RError.com Navigation

  • 主页

Mobile menu

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

Proshka's questions

Martin Hope
Proshka
Asked: 2022-08-21 15:52:02 +0000 UTC

使用未赋值的局部变量

  • 1

这是它的编译方式:

class Program
{
    delegate void Message();

    private static void GoodMooning()
    {
        Console.WriteLine("Доброе утро");
    }

    private static void GoodEvening()
    {
        Console.WriteLine("Добрый вечер");
    }

    static void Main(string[] args)
    {
        Message message;
        if(DateTime.Now.Hour < 12)
        {
            message = GoodMooning;
        }
        else 
        {
            message = GoodEvening;
        }
        Console.WriteLine(DateTime.Now.Hour);
        message();
        Console.ReadKey();
    }       
}

但它不会像这样编译并写出消息变量未初始化:

class Program
{
    delegate void Message();

    private static void GoodMooning()
    {
        Console.WriteLine("Доброе утро");
    }

    private static void GoodEvening()
    {
        Console.WriteLine("Добрый вечер");
    }

    static void Main(string[] args)
    {
        Message message;
        int a = 2;
        if(a < 12)
        {
            message = GoodMooning;
        }
        message();
        Console.ReadKey();
    }       
}
c#
  • 3 个回答
  • 10 Views
Martin Hope
Proshka
Asked: 2022-06-18 21:54:05 +0000 UTC

Wordpress get_post()函数不起作用

  • 1
global $post;
$args = array('category_name'=>'Marketing Social','tag'=>'social','post_type'=>'any');
$result = get_post($args);
print_r($result);

分类营销社会存在,有一个标签social,在这个分类的数据库中和这个标签下有3条记录。get_post()不从数据库中检索任何内容。可能是什么问题呢?

wordpress
  • 1 个回答
  • 10 Views
Martin Hope
Proshka
Asked: 2022-06-08 02:29:42 +0000 UTC

类 WP 查询 Wordpress 显示帖子

  • 0
$query = new WP_Query('p=44');
print_r($query);

此代码不按 ID 显示帖子。怎么了?

php
  • 1 个回答
  • 10 Views
Martin Hope
Proshka
Asked: 2022-05-01 17:29:43 +0000 UTC

如何在 Wordpress 中找到正确的钩子

  • 0

如何在 Wordpress 中找到所需的挂钩以将您的功能挂钩。也许有某种搜索原理,至少告诉我一些有关搜索方法的信息。

wordpress
  • 2 个回答
  • 10 Views
Martin Hope
Proshka
Asked: 2021-12-13 18:21:34 +0000 UTC

如何调整svg的大小

  • 2

如何调整这个svg的大小?更改宽度和高度会导致图像消失/裁剪

<?xml version="1.0" ?>
<svg height="1024" width="1024" xmlns="http://www.w3.org/2000/svg">
    <g>
        <title/>
            <g fill="#fff" id="svg_1" transform="translate(-10,1024) scale(0.1,-0.1) ">
                <path d="m4820,9439c-1036,-77 -1981,-503 -2723,-1228c-976,-952 -1444,-2300 -1271,-3654c216,-1693 1410,-3103 3050,-3602c1268,-386 2679,-157 3754,608c1321,941 2008,2502 1804,4100c-216,1693 -1410,3103 -3050,3602c-488,149 -1057,212 -1564,174zm331,-2689c222,-22 333,-57 383,-122c13,-18 34,-62 46,-98c26,-76 27,-163 11,-813c-10,-406 -4,-531 29,-621c39,-103 125,-150 201,-111c69,36 230,213 335,370c243,360 391,639 569,1070c36,85 84,141 134,154c20,6 303,11 651,12l615,2l52,-22c67,-30 93,-69 93,-140c0,-135 -141,-412 -383,-751c-33,-47 -158,-213 -277,-370c-263,-346 -320,-427 -360,-511c-50,-106 -38,-193 41,-296c23,-29 139,-146 258,-260c333,-319 484,-487 607,-671c88,-133 122,-231 108,-315c-7,-46 -53,-101 -105,-128c-62,-31 -157,-37 -680,-44l-495,-7l-80,27c-204,68 -340,181 -649,539c-171,198 -298,295 -386,296c-81,0 -184,-108 -228,-242c-30,-90 -41,-159 -50,-315c-11,-184 -33,-227 -146,-274c-41,-18 -551,-24 -686,-10c-271,30 -522,115 -771,262c-361,212 -582,402 -819,704c-412,526 -693,974 -1034,1650c-132,263 -287,603 -312,684c-25,84 11,153 93,179c28,9 184,14 544,19l505,5l59,-22c93,-36 132,-82 195,-235c54,-129 345,-713 436,-876c93,-165 192,-303 277,-385c105,-103 152,-128 226,-122c63,6 80,20 119,105c95,205 110,898 25,1170c-49,155 -122,214 -324,257c-35,8 -35,20 -3,67c78,112 217,166 482,188c145,12 575,13 694,1z" fill="#61B7B0" id="svg_2"/>
            </g>
    </g>
</svg>

svg
  • 1 个回答
  • 10 Views
Martin Hope
Proshka
Asked: 2020-05-24 21:36:04 +0000 UTC

无法弄清楚为什么代码不起作用

  • 0

显然问题是在这个?或者如何为发生事件的元素执行函数?

function color() {
        $(this).children().css('backgroundColor','red');
    }
    
$('#one').click(function () {
    color();
});
$('#two').click(function () {
    color();
});
.item{
        display: block;
        height: 50px;
        margin-bottom: 50px;
        border: 1px solid #0C9A9A;
    }
    .item div{
        display: block;
        height: 100%;
    }
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<div id="one" class="item">
    <div></div>
</div>
<div id="two" class="item">
    <div></div>
</div>

javascript
  • 2 个回答
  • 10 Views
Martin Hope
Proshka
Asked: 2020-05-15 01:53:40 +0000 UTC

如何在 Wordpress 菜单中更改 HTML 标记

  • 0

菜单需要从管理面板组织。此菜单结构由 Wordpress 生成

<ul>
  <li>1</li>
  <li>
    <ul>
      <li>11</li>
      <li>12</li>
      <li>13</li>
    </ul>
  </li>
  <li>2</li>
</ul>
但是这种结构需要改变

<ul>
  <li>1</li>
  <li>
    <div>
      <ul>
        <div>
          <li>11</li>
        </div>
        <div>
          <li>12</li>
        </div>
        <div>
          <li>13</li>
        </div>
      </ul>
    </div>
  </li>
  <li>2</li>
</ul>

wordpress
  • 1 个回答
  • 10 Views
Martin Hope
Proshka
Asked: 2020-05-08 17:14:32 +0000 UTC

帮我解决一个带有独立块的 HTML 和 CSS 的问题

  • 0

最初的:

<style>
   .scheme{
      min-width: 750px;
   }
</style>

<div class="all">
    <div class="container">
        <div class="row">
            <div class="col-xs-12 ">
                <p>content</p>
            </div>
        </div>
    </div>
    <div class="scheme">

    </div>
</div>
  1. 有一个块.container。这是引导容器。当屏幕宽度更改为较小的一侧时,它会按比例减小。
  2. 有一个块.scheme。此容器将包含不允许调整大小超过 750 像素的屏幕宽度的内容

必需的:

  1. 当屏幕达到 750 及以下时,Bootstrap 块按预期工作
  2. 该块.scheme应保持至少 750 像素宽,但只能滚动该块的宽度。即整个页面在Bootstrap网格下工作,这个block不会阻止页面被缩放,同时用户有机会使用水平滚动查看它。
html
  • 1 个回答
  • 10 Views
Martin Hope
Proshka
Asked: 2020-04-21 21:16:16 +0000 UTC

ajax交互表单不起作用

  • 0
<div class="col-md-6 col-xl-4">
    <div class="input-field">
      <form id="callphone">
       <!-- Hidden Required Fields -->
       <input type="hidden" name="project_name" value="a">
       <input type="hidden" name="admin_email" value="b">
       <input type="hidden" name="form_subject" value="c">
       <!-- END Hidden Required Fields -->
       <input id="phone-email" name="phoneemail" class="form-control" type="text"size="40" required>
       <label for="phone-email" class="animated-label">введите ваш email или номер телефона</label>
      </form>
     </div>
</div>
<div class="col-md-6 col-xl-4">
     <div class="buttons">
       <div id="sub" class="callback">
         <p>заказать<br> обратный звонок</p>
       </div>
       <div class="send-email">
         <p>отправить<br> e-mail </p>
       </div>
     </div>
</div>

//form email+call
$('#sub').click(function () {
    $('#callphone').submit(function () {
        let th = $(this);
        $.ajax({
            type: "POST",
            url: "./mail.php", 
            data: th.serialize()
        }).done(function() {
            alert("www");
            setTimeout(function() {
                // Done Functions
                th.trigger("reset");
            }, 1000);
        });
        return false;
    })
});
javascript
  • 1 个回答
  • 10 Views
Martin Hope
Proshka
Asked: 2020-03-19 20:57:54 +0000 UTC

如何通过多维 PHP 数组中的 id 显示所需的数组元素

  • 0
Требуется по id вывести соответственно содержимое ["thumb"]


[0]=>
array(9) {
  ["product_id"]=>
    string(2) "36"
  ["thumb"]=>
    string(65) "http://t/image/cache/catalog/armature-500x500.jpg"
  ["name"]=>
    string(42) "Арматура А1 ф10 ст3сп 11,7м"
  ["description"]=>
    string(102) "any text"
  ["price"]=>
    string(6) "1.6р."
  ["special"]=>
    bool(false)
  ["tax"]=>
    bool(false)
  ["rating"]=>
    float(0)
  ["href"]=>
    string(34) "http://t.loc/ipod-nano"
}
[1]=>
 array(9) {
  ["product_id"]=>
    string(2) "41"
  ["thumb"]=>
    string(65) "http://t.loc/image/cache/catalog/armatura-500x500.png"
  ["name"]=>
    string(38) "Арматура А1 ф18 А240 11,7м"
  ["description"]=>
    string(183) "Арматура стальная.
  ["price"]=>
    string(9) "1566.0р."
  ["special"]=>
    bool(false)
  ["tax"]=>
    bool(false)
  ["rating"]=>
    float(0)
  ["href"]=>
    string(29) "http://t.loc/imac"
}
php
  • 1 个回答
  • 10 Views
Martin Hope
Proshka
Asked: 2020-02-19 15:35:10 +0000 UTC

Wordpress 不显示错误

  • 0

wp-config.php

 define( 'WP_DEBUG', true );
 define( 'WP_DEBUG_DISPLAY', true );

在浏览器中:

在此处输入图像描述

仅此而已。问:我怎样才能找出错误是什么?

wordpress
  • 1 个回答
  • 10 Views
Martin Hope
Proshka
Asked: 2020-12-13 19:34:02 +0000 UTC

VUE js和这个——如何使用

  • 0

this在对象中创建的函数内部的调用Vue指向“Vue”对象本身。如何引用this发生事件的元素 - 在这种情况下,单击

<div id="app">
  <div class="menu-item">          
       <div class="item active" v-on:click="menuItem">К</div>
       <div class="item">С</div>
       <div class="item">П</div>
       <div class="item">O</div>
  </div>
</div>

<script>
    var app = new Vue({
        el: '#app',
        methods: {
            menuItem: function (event) {
                let elements = document.querySelectorAll('.menu-item > .item');
                for (let elem of elements) {
                    if(elem.classList.contains('active')){
                        elem.classList.remove("active");
                        console.log(this);
                    }
                }
            }
        }
    })
</script>
javascript
  • 1 个回答
  • 10 Views
Martin Hope
Proshka
Asked: 2020-12-10 03:51:25 +0000 UTC

Vue 未通过 Webpack4 连接

  • -1

控制台错误:未定义 Vue

如果您通过 CDN 连接 - 一切正常

虽然输出文件包含main.66905f9e91666cf52fc4.js?da38ad338a15dcb4c609代码vue.js

我的行动:

  1. 下载 npm i vue 包

  2. 在 index.js 中导入 -> 导入 'vue'

  3. 在 webpack 配置 -> index.js 入口点 -> 出口点 -> dist/js/main.js

  4. main.js 成功包含在页面底部

  5. 检查 main.js 并在那里找到缩小的 vue.js

  6. 但是 Vue 的代码不起作用

webpack.config.js

// Webpack v4
const path =                    require('path');
const MiniCssExtractPlugin =    require('mini-css-extract-plugin');
const FileManagerPlugin =       require('filemanager-webpack-plugin');
const { CleanWebpackPlugin } =  require('clean-webpack-plugin');
const HtmlWebpackPlugin =       require('html-webpack-plugin');
const WebpackMd5Hash =          require('webpack-md5-hash');

module.exports = {
  entry: { main: './src/js/index.js' },
  output: {
    path: path.resolve(__dirname, 'dist'),
    filename: 'js/[name].[chunkhash].js'
},
module: {
    rules: [
        {
            test: /\.js$/,
            exclude: /node_modules/,
            use: {
                loader: "babel-loader"
            }
        },
        {
            test: /\.scss$/,
            use:  [  'style-loader', MiniCssExtractPlugin.loader, 'css-loader', 'postcss-loader', 'sass-loader']
        },
        {
            test: /\.(png|jpe?g|gif)$/i,
            loader: 'file-loader',
            options: {
                name: 'images/[name].[ext]',
            }
        }
    ]
},
plugins: [
    new CleanWebpackPlugin(),
    new MiniCssExtractPlugin({
        filename: 'style.[contenthash].css'
    }),
    new FileManagerPlugin({
        onEnd: {
            copy: []
        }
    }),
    new HtmlWebpackPlugin({
        inject: false,
        hash: true,
        template: './src/index.html',
        filename: 'index.html'
    }),
    new WebpackMd5Hash()
]

}

包.json

"devDependencies": {
"autoprefixer": "^9.7.3",
"babel-core": "^6.26.3",
"babel-loader": "^8.0.6",
"babel-preset-env": "^1.7.0",
"clean-webpack-plugin": "^3.0.0",
"css-loader": "^3.2.1",
"cssnano": "^4.1.10",
"file-loader": "^5.0.2",
"filemanager-webpack-plugin": "^2.0.5",
"html-webpack-plugin": "^3.2.0",
"mini-css-extract-plugin": "^0.8.0",
"node-sass": "^4.13.0",
"postcss-loader": "^3.0.0",
"sass-loader": "^8.0.0",
"style-loader": "^1.0.1",
"vue-loader": "^15.7.2",
"webpack": "^4.41.2",
"webpack-cli": "^3.3.10",
"webpack-dev-server": "^3.9.0",
"webpack-md5-hash": "0.0.6"
},
"dependencies": {
  "@babel/core": "^7.7.4",
  "bootstrap": "^4.4.1",
  "jquery": "^3.4.1",
  "popper.js": "^1.16.0",
  "vue": "^2.6.10"
}

index.js

import 'vue';

索引.html

    </footer>
<script src="js/main.66905f9e91666cf52fc4.js?da38ad338a15dcb4c609"></script>
<script>
    var app = new Vue({
        el: '#app',
        data: {
            message: 'Hello Vue!'
        },
        methods: {
            setMessage: function(event){
                this.message = event.target.value;
            }
        }
    })
</script>
vue.js
  • 1 个回答
  • 10 Views
Martin Hope
Proshka
Asked: 2020-12-04 21:02:32 +0000 UTC

Opencart 3 中用于在管理部分编辑产品的 .twig 模板在哪里

  • 1
admin/index.php?route=catalog/product/edit&user_token=xpBmtjPtwnIIy2OdtS1Z1fe6Zmvjki2w&product_id=42

找不到此模板进行编辑

这不是一个:admin\view\template\catalog\product_form.twig

opencart3.x
  • 1 个回答
  • 10 Views
Martin Hope
Proshka
Asked: 2020-11-21 17:44:44 +0000 UTC

如何让 OpenCart 3 和 VUE.js 成为朋友

  • 1

事实上,在 Opencart3 中,{{}} 指令负责在 .twig 模板中显示变量。在 VUE 中,{{}} 指令还负责显示变量。结果,当连接到VUE twig模板时,什么都没有显示

树枝模板:

 <section id="app">
   <p v-on:click="delBr">{{ age }}</p>
 </section>

<script>
var app = new Vue({
    el: '#app',
    data: {age:25},
    methods: {
        delBr: function(){
            var width = document.body.clientWidth;
            if(width < 992)
                console.log(width)
        }                
})
</script>

delBr 功能有效

vue.js
  • 1 个回答
  • 10 Views
Martin Hope
Proshka
Asked: 2020-11-12 19:56:31 +0000 UTC

如何在 Twig 中显示所需的周期数

  • 0
{% for category in categories %}
   <li><a href="{{ category.href }}">{{ category.name}}</a></li>
{% endfor %}

要求只显示指定数组的前三个值

twig
  • 1 个回答
  • 10 Views
Martin Hope
Proshka
Asked: 2020-02-12 19:10:41 +0000 UTC

连接材料设计图标

  • 1

html:<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">

CSS:.item-main-ldown:before position: absolute content: '\f31d' display: block font-family: "Material Icons" color: #ffffff left: 0 top: 90px font-size: 46px

不显示

html
  • 1 个回答
  • 10 Views
Martin Hope
Proshka
Asked: 2020-12-27 16:15:37 +0000 UTC

如何在 Adob​​e XD 中使用 Font Awesome [关闭]

  • 0
关闭。这个问题需要澄清或补充细节。目前不接受回复。

你想改进这个问题吗?通过编辑此帖子添加更多详细信息并澄清问题。

3年前关闭。

改进问题

如何在 Adob​​e XD 中包含或使用图标字体?

adobexd
  • 1 个回答
  • 10 Views
Martin Hope
Proshka
Asked: 2020-06-26 17:00:21 +0000 UTC

为块设置什么属性,使其位于页面中心

  • 0

我正在为菜单制作一个固定块。

.header-fixed {
    position: fixed
    z-index: 1000
    background-color: #ffffff
    top: 0
}

问题:如何以任何屏幕分辨率使块居中?

css
  • 1 个回答
  • 10 Views
Martin Hope
Proshka
Asked: 2020-06-25 21:00:07 +0000 UTC

使用 jQuery 集

  • 1

写了一个卷轴。我想对单击的项目进行额外的元素选择并对其应用样式。提示选择的正确语法。对这条线感兴趣$(this).$("menu.main-mnu > ul > li").addClass("active");

$("a[href^='#']").click(function() {
  var _href = $(this).attr("href");
  $("html, body").animate({
    scrollTop: $(_href).offset().top + "px"
  }, 2000);
  $("menu.main-mnu > ul > li").removeClass("active");
  $(this).$("menu.main-mnu > ul > li").addClass("active");
  return false;
});
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