我有一个v-data-table,正在尝试向其中添加分页。我在这里跟随了示例文档,看不到我在做什么错。创建我的组件后,它将调用我的后端以填充项目列表。然后将其传递到数据表。
我也有一个搜索栏,如果我输入任何内容,那么页面编号就会弹出。
的HTML
<v-data-table
:headers="headers"
:items="incidents"
:search="search"
:pagination.sync="pagination"
hide-actions
class="elevation-1"
item-key="incident_number"
>
</v-data-table>
/* table row html in between */
<div class="text-xs-center pt-2">
<v-pagination v-model="pagination.page" :length="pages" </v-pagination>
</div>
Run Code Online (Sandbox Code Playgroud)
JS
我有一个计算出的属性,可以像示例中那样计算出页码。
computed: {
pages ()
{
if (this.pagination.rowsPerPage == null || this.pagination.totalItems == null)
{
return 0
}
return Math.ceil(this.pagination.totalItems / this.pagination.rowsPerPage)
},
}
Run Code Online (Sandbox Code Playgroud) 我正在尝试创建网格布局,但是遇到了麻烦。
我要创建的布局如下图所示。显示起来比解释容易。
我尝试使用vuetify网格布局系统来获取它,但无法很好地填充所有空间。我的代码如下。
有没有一种创建此网格布局的好方法?
<v-container fluid grid-list-md box>
<v-layout row>
<v-flex d-flex xs3>
<v-layout row wrap>
<v-card color="orange lighten-2" tile flat>
<v-card-text>{{ lorem.slice(0, 90) }}</v-card-text>
</v-card>
<v-divider></v-divider>
<v-card color="orange lighten-2" tile flat>
<v-card-text>{{ lorem.slice(0, 90) }}</v-card-text>
</v-card>
<v-divider></v-divider>
<v-card color="orange lighten-2" tile flat>
<v-card-text>{{ lorem.slice(0, 90) }}</v-card-text>
</v-card>
<v-divider></v-divider>
<v-card color="orange lighten-2" tile flat>
<v-card-text>{{ lorem.slice(0, 90) }}</v-card-text>
</v-card>
</v-layout>
</v-flex>
<v-flex d-flex xs9>
<v-layout row wrap>
<v-layout row>
<v-flex d-flex>
<v-card color="blue-grey" dark tile flat>
<v-card-text>{{ …
Run Code Online (Sandbox Code Playgroud) 在为我的 Flask 应用程序编写测试时,我在尝试设置 Flask 配置设置时遇到了一个问题。
通常,我这样做:
import unittest
from factory import create_app
class ConfigTests(unittest.TestCase):
def setUp(self):
app = create_app('flask_test.cfg')
app.testing = True
self.app = app.test_client()
def test_app_is_development(self):
self.assertTrue(self.app.config['SECRET_KEY'] is 'secret_key')
self.assertTrue(self.app.config['DEBUG'] is True)
Run Code Online (Sandbox Code Playgroud)
这导致了错误
AttributeError: 'FlaskClient' 对象没有属性 'config'
仅从调试中我看到没有“配置”属性,而是我不得不self.app.application.config
让它工作。
import unittest
from factory import create_app
class ConfigTests(unittest.TestCase):
def setUp(self):
app = create_app('flask_test.cfg')
app.testing = True
self.app = app.test_client()
def test_app_is_development(self):
self.assertTrue(self.app.application.config['SECRET_KEY'] is 'secret_key')
self.assertTrue(self.app.application.config['DEBUG'] is True)
Run Code Online (Sandbox Code Playgroud)
我在做什么,Flask 是否在更新中改变了这一点,或者有更好的方法来做到这一点?
编辑:在顶部块中错误地发布了代码,现在是正确的
I'm trying to add SSL certs (generated with LetsEncrypt) to my nginx. The nginx is built from a docker-compose file where I create a volume from my host to the container so the containers can access the certs and private key.
volumes:
- /etc/nginx/certs/:/etc/nginx/certs/
Run Code Online (Sandbox Code Playgroud)
When the nginx container starts and fails with the following error
[emerg] 1#1: BIO_new_file("/etc/nginx/certs/fullchain.pem") failed
(SSL: error:02001002:system library:fopen:No such file or
directory:fopen('/etc/nginx/certs/fullchain.pem','r')
error:2006D080:BIO routines:BIO_new_file:no such file)
Run Code Online (Sandbox Code Playgroud)
My nginx config file looks like this:
server {
listen …
Run Code Online (Sandbox Code Playgroud)