我的vue组件中有一个var adder = function(a, b) {
return 'the sum of the two number is ${a + b}'
}
module.exports = adder;
。我将<b-form-input>
设置为一组电子邮件地址。
这是用户可以开始聊天的电子邮件地址的列表。我用来获取这些电子邮件地址的方法,实际上无法阻止:options
拥有当前登录用户的电子邮件地址。
这是一个问题,因为显然用户不应该与他们自己开始聊天。
是否可以根据这些<b-input-select>
与当前登录用户的电子邮件地址不同来有条件地呈现这些信息?
我当前拥有的标签是这样的:
:option
谢谢。
答案 0 :(得分:1)
您可以使用 from twisted.enterprise import adbapi
from twisted.internet import task
import logging
from datetime import datetime
from twisted.internet import reactor
from twisted.internet.defer import inlineCallbacks
"""
Test DB : This File do database connection and basic operation.
"""
log = logging.getLogger("Test DB")
dbpool = adbapi.ConnectionPool("MySQLdb",db="xxxx",user="guza",passwd="vQsx7gbblal8aiICbTKP",host="192.168.15.01")
class MetersCount():
def getTime(self):
log.info("Get Current Time from System.")
time = str(datetime.now()).split('.')[0]
return time
def getTotalMeters(self):
log.info("Select operation in Database.")
getMetersQuery = """ SELECT count(met_id) as totalMeters FROM meters WHERE DATE(met_last_heard) = DATE(NOW()) """
return dbpool.runQuery(getMetersQuery).addCallback(self.getResult)
def getResult(self, result):
print ("Receive Result : ")
print (result)
# general purpose method to receive result from defer.
return result
def insertMetersCount(self, meters_count):
log.info("Insert operation in Database.")
insertMetersQuery = """ INSERT INTO meter_count (mec_datetime, mec_count) VALUES (NOW(), %s)"""
return dbpool.runQuery(insertMetersQuery, [meters_count])
def checkDB(self):
d = self.getTotalMeters()
d.addCallback(self.insertMetersCount)
return d
a= MetersCount()
a.checkDB()
reactor.run()
属性来过滤选项数据。
computed