Deprecated: Constant PDO::MYSQL_ATTR_USE_BUFFERED_QUERY is deprecated since 8.5, use Pdo\Mysql::ATTR_USE_BUFFERED_QUERY instead in /www/wwwroot/www.1998123.xyz/var/Typecho/Db/Adapter/Pdo/Mysql.php on line 71
admin 发布的文章 - 98123_学习与记录

admin 发布的文章

设置GO111MODULE环境变量

要使用go module 首先要设置GO111MODULE=on,GO111MODULE 有三个值,off、on、auto,off 和 on 即关闭和开启,auto 则会根据当前目录下是否有 go.mod 文件来判断是否使用 modules 功能。无论使用哪种模式,module 功能默认不在 GOPATH 目录下查找依赖文件,所以使用 modules 功能时请设置好代理。
在使用 go module 时,将 GO111MODULE 全局环境变量设置为 off,在需要使用的时候再开启,避免在已有项目中意外引入 go module。

windows:

   set GO111MODULE=on

mac:

export GO111MODULE=on

然后输入

go env

查看 GO111MODULE 选项为 on 代表修改成功

在安卓LinearLayout布局中使用ScrollView里面只能包含一个子组件

如果里面是textview 只能包含一个 不能包含第二个
正确列子

  <ScrollView
        android:id="@+id/scrollView"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:scrollbars="none"
        android:layout_weight="1"
        >

        <TextView
            android:id="@+id/text_show"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text=" "
             />


    </ScrollView>

错误列子

<ScrollView
        android:id="@+id/scrollView"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:scrollbars="none"
        android:layout_weight="1"
        >

        <TextView
            android:id="@+id/text_show"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text=" "
             />
  <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"/>

    </ScrollView>

添加单个元素
添加当儿元素比较简单,只需要一个关键字push 他的意思就是把当前元素添加到数组的最后

写法是: this.lists.push(您要添加的元素)       

直接添加数组元素就更简单了

  this.newsList = [...this.newsList, ...list];

他的意思就是,把当前数组this.newsList  和临时数组list  组成一个新的数组,然后重新赋值给this.newsList 

vue 数据添加分为三种方法:1.unshift(),2.push(),3.splice()

1.unshift() //数组头部添加一条新数据

2.push() //数组末端添加一条新数据

3.splice() //数组操作